This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes creating jar 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 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "creating jar" Watch "creating jar" New topic
Author

creating jar

prachi jahagirdar
Greenhorn

Joined: Feb 02, 2004
Posts: 11
hello,
i am trying to create a jar file using 'jar' command. my directory structure is-
c:
root
test1
applet
*.class
if i create a jar for it and extract that jar. it is creating the same path(c:\root\test1\applet) again. but i just want the 'applet' folder to be jared and extract the same in some other directory.
my working directory is 'root'.
please tell me how do i do it. does it require to modify META-INF/MANIFEST.MF. If yes, how it is done?
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

try
jar cvf myjar.jar applet/*.class from one folder up from applet, or
jar cvf myjar.jar *.class from applet folder depending on your requirements.
In questions like this, it is helpful to include the command that you used that was causing problem.
cheers


The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
Tweets
 
wood burning stoves
 
subject: creating jar