You can run a JAR file if a main class is specified in the manifest.
You must also specify the class path in the manifest. The JAR file's class path consists of the relative paths to any other JAR files that contain classes that your JAR file needs. When running a JAR file, the class path in the IDE and command line is ignored.
An example of a runnable JAR file's manifest is:
Manifest-Version: 1.0 Main-Class: teststuff.Arch Class-Path: arch.jar ../archiver/archiver.jar ../netbeans/lib/ext/jaxp.jar ../fjce/lib/ext/xerces.jar
To run a JAR file:
See Also | |
---|---|
Creating a JAR File
Modifying a JAR File Updating a JAR File Creating a JAR Manifest |