This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Java in General and the fly likes extracting all the contents of a jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "extracting all the contents of a jar file" Watch "extracting all the contents of a jar file" New topic
Author

extracting all the contents of a jar file

mythily prakash
Ranch Hand

Joined: Jan 27, 2006
Posts: 31
hi,

Any one can tell me how to implement the command
"jar -xvf myjar.jar" programmatically.I've written the program as



but it throws the following exception as:

Entry Name: META-INF/
ex.jar opened.
META-INF/ extracted.
ex.jar closed.

Entry Name: META-INF/MANIFEST.MF
ex.jar opened.
ex.jar closed.
Exception in thread "main" java.io.FileNotFoundException: META-INF\MANIFEST.MF (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:201)
at java.io.FileOutputStream.<init>(FileOutputStream.java:92)
at jara.extract(jara.java:46)
at jara.main(jara.java:14)

Pls tell me how to recover from it.


Best Regards,<br />Mythily.S<br />9886530336
Joni Salonen
Ranch Hand

Joined: Jan 07, 2006
Posts: 53
You need to create the directory first:

mythily prakash
Ranch Hand

Joined: Jan 27, 2006
Posts: 31
Thank u Friend,
Here is my code :

Thank u somuch.!
 
GeeCON Prague 2014
 
subject: extracting all the contents of a jar file