If a JAR file's Class-Path contains successive blanks, then
jar i x.jar
fails. I guess that the jar utility treats the successive blanks as delimiters around an empty string and then tries to resolve the empty string as a path relative to the JAR's directory. This yields the directory itself which, of course, cannot be opened as a JAR.
The jar utility should (1) tolerate such successive blanks by ignoring them and (2) report the context (what JAR is being processed, what Class-Path entry is being processed) at the time of any such an error.
This also happens when you try to index y.jar which refers to x.jar in its Class-Path.
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.jar.JarFile.<init>(JarFile.java:133)
at java.util.jar.JarFile.<init>(JarFile.java:70)
at sun.tools.jar.Main.getJarPath(Main.java:935)
at sun.tools.jar.Main.getJarPath(Main.java:951)
at sun.tools.jar.Main.genIndex(Main.java:967)
at sun.tools.jar.Main.run(Main.java:217)
at sun.tools.jar.Main.main(Main.java:1044)
jar i x.jar
fails. I guess that the jar utility treats the successive blanks as delimiters around an empty string and then tries to resolve the empty string as a path relative to the JAR's directory. This yields the directory itself which, of course, cannot be opened as a JAR.
The jar utility should (1) tolerate such successive blanks by ignoring them and (2) report the context (what JAR is being processed, what Class-Path entry is being processed) at the time of any such an error.
This also happens when you try to index y.jar which refers to x.jar in its Class-Path.
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.jar.JarFile.<init>(JarFile.java:133)
at java.util.jar.JarFile.<init>(JarFile.java:70)
at sun.tools.jar.Main.getJarPath(Main.java:935)
at sun.tools.jar.Main.getJarPath(Main.java:951)
at sun.tools.jar.Main.genIndex(Main.java:967)
at sun.tools.jar.Main.run(Main.java:217)
at sun.tools.jar.Main.main(Main.java:1044)