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]
# 1
Hi ozinke ,Please refer this URL. http://java.sun.com/docs/books/tutorial/jar/basics/run.htmlI hope this will help you.ThanksBakrudeen
bakrudeen_indts at 2007-6-29 3:10:41 > top of Java-index,Archived Forums,Java Programming...
# 2

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

jdaguet at 2007-6-29 3:10:41 > top of Java-index,Archived Forums,Java Programming...
# 3
Hi,Thanks a lot for your answers ;-)Have a nice day !!!cuoliver
ozinke at 2007-6-29 3:10:41 > top of Java-index,Archived Forums,Java Programming...
# 4
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.
blaine.simpson at 2007-6-29 3:10:41 > top of Java-index,Archived Forums,Java Programming...