New Page 1
How to make executable jar files in JDK1.3.1?,
I can make jar in JDK 1.3.1 but when I developed a package in java(application) I was Unable to make executable jar.?
Instructions for creating an Excecutable .jar file
Make or modify the Manifest.MF to YourManifest.MF.
1) YourClassNameWithMain is the class name (case sensitive)without .class extention
2) No extra spaces following the YourClassName withMain.
Manifest-Version:1.0
Main-Class: YourClassNameWithMain
Created-by:1.2(Sun Microsystems Inc.)
On Command line : type the following
jar cvfm YourJarFileName.jar YourManifest.MF*
or
jar cvfm YourJarFileName.jar YourManifest.MF -C classes yourClassPath
Drag-drop the YourJarFileName.jar to your desktop double click it, it runs
If your program only has System.out.println ("whatever"); statements, it will
display nothing. The same will happen when you run it useing java at command line
You need some windows code to see it run
Instructions for creating a .jar file
jar utility comes with your JDK1.2.2 It compresses your
file similar to zip utility, and more Java.
You can use it on any machine installed JDK
Create a folder name it anything
Make that folder your current directory
put all your files for turning in (do not put any extra)
in that directory.
Be sure to put your html file, if there is one
At your dos prompt, while you are in the directory that you created , type in:
jar cvf Prj02.jar*
This will take ALL the files in the directory including
subdirectories and place them in a .jar file Prj02 that can be
replaced by any of your desired jar file name.
To test it, you can extract the contents of jar file by typing:
jar xvf Prj02.jar
Some user posted Query is on this location in my
codes so this is answer.
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=3035&lngWId=2
|