Java Application Template GUI Tutorial Part 5/5 - How to make an executable JAR file
Now we're almost done. We just need a manifest file to tell the java interpreter where
to find the actual starting class of the program.
file "manifest":
Manifest-Version: 1.2
Main-Class: Splash
Created-By: 1.4 (Sun Microsystems Inc.)
Compile the whole application with:
compile.sh
#!/bin/sh
javac Splash.java
javac Main.java
jar cvfm Splash.jar mymanifest Splash.class SplashWindow.class Main.class
Main\$1.class Main\$2.class Main\$3.class Main\$4.class
Main\$5.class App1.class splash.gif
compile.bat
javac Splash.java
javac Main.java
jar cvfm Splash.jar mymanifest Splash.class SplashWindow.class Main.class
Main$1.class Main$2.class Main$3.class Main$4.class
Main$5.class App1.class splash.gif
Run the application with:
java -jar Splash.jar
or just click on the icon of the java application.
TROUBLESHOOTING AND ERRORS see How to make a JAVA application - executable JAR archive
DOWNLOAD THE SOURCE CODE (~10k ZIP file)
PART 1
PART 2
PART 3
PART 4
PART 5
Last-Modified: Sat, 04 Feb 2006 16:03:09 GMT