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

J A R How To

 
Benjoe Reyes
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do you create a jar??? what is manifest.tmp??? am i the one to create it??? what should be in it???
please give me a step by step example
thanks
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Jar File is really just a zipped file containing all your classes in their subdirectories and associated files.
The Manifest is the file that you create to go along with your jar to give the jvm a clue as to which of these zillion class files is the one that has the main method in it. Of course it does other stuff also.
[ December 09, 2002: Message edited by: Cindy Glass ]
 
Benjoe Reyes
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cindy,
so i just type in one file (the source or the class file???)in a note pad and save as : manifest tmp???
 
Benjoe Reyes
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cindy,
so i just type in one file (the source or the class file???)in a note pad and save as : manifest.tmp???
 
Rob Chung
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your command line, do
jar -help
and you'll see the options available.
e.g. To create a jar with all the classes within a directory:
jar cvf mfJar.jar c:/myDir/*.class
 
Benjoe Reyes
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic