SETTING A MAIN CLASS IN A MANIFEST Do your users have difficulty running Java applications? You can create a Windows BAT file and a UNIX SH file to help them invoke the application, but if you have a GUI, there's a much simpler way. On many modern desktops, .jar files are configured to automatically run when selected. This turns a .jar file into a normal application, from the users' point of view. It is something they download, put on their desktop, and click on when they want to use it. This magic is achieved amazingly easily. Each .jar file has a manifest, which is stored under the following filename: META-INF/MANIFEST.MF The jar command provides an -m option to specify the file to be used as a manifest. That way, an application called JarCreator can be created with: jar mf META-INF/JarCreator.mf com.generationjava.tools.JarCreator.class A very basic manifest contains the version and creator, which is often the name of the JDK vendor. For example, on Mac OS X, the manifest looks like: Manifest-Version: 1.0 Created-By: 1.3.0 (Apple Computer, Inc.) However, the real action starts with the addition of a third line: Manifest-Version: 1.0 Main-Class: com.generationjava.util.JarCreator Created-By: 1.3.0 (Apple Computer, Inc.) The third line provides the name of the class to run a static main method in. It's equivalent to running the java command on that class with no arguments. Once the .jar is packaged and clicked upon, the com.generationjava.util.JarCreator class' main method will be invoked and the application will begin. ----------------------------------------