badge

Search Flipkart

Friday, February 3, 2012

Make executable jar in Linux

1. Put your .class files in a folder
2. create a file manifest.txt in that folder and type
Quote:
Main-Class: ClassNameContainigMainMethod
this line inside that file and this line should end with a return{enter key}
3. then create a jar with this command{cd to go to above folder by terminal}
Quote:
jar cvfm MyExecJar.jar manifest.txt *.class
4. make this jar executable by the command 
Quote:
chmod +x MyExecJar.jar
Now you can double click to run this program/jar

No comments:

Post a Comment