How do I create an executable JAR File ?
Hi,
Let's say I have several Class Files that perform a special task.
How do I bundle them in a JAR file and make it executable, so that the user simply types "prog.jar" and is happy.
I wonder how that works, as I have to tell the starting point for execution.
Does anybody now ?
cu
Oliver
[340 byte] By [
ozinke] at [2007-9-26 1:56:00]

Three importants things to do :
- don't forget to indicate in your manifest.mf the main class and the pacckage
ex:
Manifest-Version: 1.0
Main-Class: mypackage.MyMainClass
Created-By: 1.3.0 (Sun Microsystems Inc.)
- don't forget to associate the .jar file with the application java.exe -jar -classpath %CLASSPATH%
- don't forget to set the environment CLASSPATH correctly
Hope this help
Jean
If you want to know how to make it execute (in addition to how tobuild the jar file, which has already been answered), that's OS-specific, so specify.