unarchiving jar fails

Q

qazmlp

Is there any option which disables the automatic creation of
non-existing directories, while unarchiving a .jar file?

Here is what my jar file contains:
user@machine: jar tf myArchive.jar
META-INF/
META-INF/MANIFEST.MF
src/../intf/myModule.class
src/myConstants.class
src/myImpl.class

And, here is what the error message that is reported:
user@machine: jar xvf myArchive.jar
created: META-INF/
inflated: META-INF/MANIFEST.MF
java.io.IOException: src/../intf/ : could not create directory
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at sun.tools.jar.Main.extractFile(Compiled Code)
at sun.tools.jar.Main.extract(Compiled Code)
at sun.tools.jar.Main.run(Main.java:190)
at sun.tools.jar.Main.main(Main.java:778)

What is the root-cause of this error? How do I circumvent it?
 
O

Oscar kind

qazmlp said:
Is there any option which disables the automatic creation of
non-existing directories, while unarchiving a .jar file?

Here is what my jar file contains:
user@machine: jar tf myArchive.jar
META-INF/
META-INF/MANIFEST.MF
src/../intf/myModule.class

Ouch! ".." means "parent directory" on most systems.

You may use a zip tool to unzip it. On Linux, the unzip command
distributed with Debian supports a "-j" flag, that ignores any directory
structure while unzipping (and deposits the extracted files in the
extraction directory).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top