JAVA [creating Jar files]
To create a jar file execute this command given below
jar cf jar-file input-file(s)
//input files are .class files and extra files you have used like music,jars etc.
For more you can see this Creating JAR files
After creation you must specify the main class using manifest.
Ways to update a jar file with manifest……
I have created a text file as manifest like aaa.txt which contains
[Code]Main-class: Mainclassname
[/Code]
//a new line or enter must be pressed after Mainclassname before saving
Updating a jar file with main class, you have to move the jar file to the BIN folder of JDK. Then using the command propmt executed the commands given below:
jar umf aaa.txt calender.jar jar xvf calender.jar type META-INF\MANIFEST.MF
Now double-click on your JAR file….
Thanking you,
Ujjal
Posted on October 23, 2011, in Tutorial and tagged create, creating jar, double click, executable, how to run, jar, Java, linux, windows. Bookmark the permalink. 3 Comments.
Pingback: "Cannot find main class" error when creating a .jar!
Pingback: Single executable jar
Pingback: Converting a .JAR Into .EXE for WIndows user « Me, when programming