This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Java

Lavanya Balaraman
Greenhorn

Joined: Feb 17, 2009
Posts: 10
How to create a jar file in java please any body help me

Thank you

Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1527
    
    5

//if not any executable jar i.e does not have any manifest
jar -cfM jarfilename.jar yourclassfilename.class

//if an executable jar i.e. has a manifest file too

-jar -cfm jarfilename.jar manifestfilename.mft yourclassfilename.class


Swastik
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
In the future, please UseAMeaningfulSubjectLine. The one you chose is particularly unhelpful on this site where all questions deal with Java in one way or another.

You may want to work read the Java Tutorial chapter on jar files: http://java.sun.com/docs/books/tutorial/deployment/jar/index.html
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java
 
jQuery in Action, 3rd edition