aspose file tools*
The moose likes Beginning Java and the fly likes How to create Jar file[Greenhorn] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to create Jar file[Greenhorn]" Watch "How to create Jar file[Greenhorn]" New topic
Author

How to create Jar file[Greenhorn]

Kris Danielewski
Greenhorn

Joined: Apr 01, 2009
Posts: 25
I have seen few examples online but i can;t make my own jar file...
I aslo searched forum , however found only more advanced related topics...
Could someone please write to me step by step how to do it?
My class name Game.java (contains main)
thanks...
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Kris:

Try this page.

John
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2628
    
    9

Hi Kris, you should check out the help for the jar command "jar -help"

Simple example: "java cvfm <filename>.jar manifest.txt -C classes ." or "jar cvfe <filename>.jar <main class with full package> -C classes ."

classes is the directory containing all .class files. The period "." represents everything in that directory. The manifest file contains what the main class, classpath if any etc

Sample manifest:


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

@Kris
http://faq.javaranch.com/java/UseAMeaningfulSubjectLine

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create Jar file[Greenhorn]