Consider:
$ cd /tmp
$ rm -fr foo
$ mkdir -p foo/bar
$ touch foo/bar/file
$ zip -r file.zip foo/bar
adding: foo/bar/ (stored 0%)
adding: foo/bar/file (stored 0%)
$ rm -fr t
$ mkdir t
$ cd t
$ /usr/local/java/jdk1.2/solaris/bin/jar xvf ../file.zip
java.io.IOException: foo/bar/: could not create directory
at sun.tools.jar.Main.extractFile(Main.java:404)
at sun.tools.jar.Main.extract(Main.java:384)
at sun.tools.jar.Main.run(Main.java:105)
at sun.tools.jar.Main.main(Main.java:533)
The problem is the the zip archive contains the directory entry for
"foo/bar/", but not for "foo/" and jar doesn't have a "mkdir -p"
like behavior.
See also comments for a message about how this can be a build
problem.
anand.palaniswamy@Eng 1998-04-28
$ cd /tmp
$ rm -fr foo
$ mkdir -p foo/bar
$ touch foo/bar/file
$ zip -r file.zip foo/bar
adding: foo/bar/ (stored 0%)
adding: foo/bar/file (stored 0%)
$ rm -fr t
$ mkdir t
$ cd t
$ /usr/local/java/jdk1.2/solaris/bin/jar xvf ../file.zip
java.io.IOException: foo/bar/: could not create directory
at sun.tools.jar.Main.extractFile(Main.java:404)
at sun.tools.jar.Main.extract(Main.java:384)
at sun.tools.jar.Main.run(Main.java:105)
at sun.tools.jar.Main.main(Main.java:533)
The problem is the the zip archive contains the directory entry for
"foo/bar/", but not for "foo/" and jar doesn't have a "mkdir -p"
like behavior.
See also comments for a message about how this can be a build
problem.
anand.palaniswamy@Eng 1998-04-28
- relates to
-
JDK-4126852 JAR tool in JDK1.2 causes FileNotFoundException by removing any beginning '/'
-
- Closed
-