Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create Jar file[Greenhorn]

 
Kris Danielewski
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kris:

Try this page.

John
 
K. Tsang
Bartender
Posts: 3502
14
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic