Friday, October 3, 2008

How to make a JAVA application - executable JAR archive

Save all files from below into a directory. (rename *.java.txt to *.java)
Create a batch file with the following content:
javac DiveLog.java
jar cvfm DiveLog.jar mymanifest DiveLog.class DiveLog$1.class DiveLog$2.class Welcome.class

Watch the line wrap: There are only 2 lines in the batch file, one starting with javac and the other with jar.
Run the batch file and it should compile the application and create DiveLog.jar, which can be clicked in order to run it.

You can also run the application from the command line by typing:
java -jar DiveLog.jar
which does the same like clicking on the icon of the application, but you can see any output written by System.out.println("..."); or error messages.

Click Here To Read More

1 comment:

Prakash Krishnan said...

What is the command run another class which is inside the excecutable jar