sparafucile17
Programmer
Can anyone explain how to create a Java Archive(JAR)? I'd like to create one, so that the user one has to click on one file to run an application. I got pieces of help from the sun developer site, but not everything.
Here is what I found:
-----------------------
The good news is that the Java 2 Platform now includes an executable JAR file. When you archive your classes, you just need to include the Main-Class parameter in the manifest to tell the JVM where your main method is.
For example, if the main method was in the file, myclass, create a manifest file, for example, mymanifest, with the following lines
Manifest-Version: 1.0
Main-Class: myclass
The JAR file is created as follows:
jar cmf mymanifest myjar myclass.class
You can include other classes in the JAR file by adding them to the end of the command line. To execute this JAR file, called myjar, you can either double click on the myjar icon or use the command java -jar myjar.
-----------------------
Problem is that I don't understand what they mean by a manifest file! (What is it's extension?)
Can anyone Help?
Jeff Tackett
Here is what I found:
-----------------------
The good news is that the Java 2 Platform now includes an executable JAR file. When you archive your classes, you just need to include the Main-Class parameter in the manifest to tell the JVM where your main method is.
For example, if the main method was in the file, myclass, create a manifest file, for example, mymanifest, with the following lines
Manifest-Version: 1.0
Main-Class: myclass
The JAR file is created as follows:
jar cmf mymanifest myjar myclass.class
You can include other classes in the JAR file by adding them to the end of the command line. To execute this JAR file, called myjar, you can either double click on the myjar icon or use the command java -jar myjar.
-----------------------
Problem is that I don't understand what they mean by a manifest file! (What is it's extension?)
Can anyone Help?
Jeff Tackett