I was trying to do a "jar uvf" to update a file in src.jar and that fails,
but updating a file into rt.jar works. This is probably because src.jar
is created with zip but rt.jar is created with jar. Note that on Win32
we create src.jar with jar as well, so it is only the Solaris src.jar
that fails. It would be good to know why updating a zip file created by
zip fails -- it could either be:
- the zip format has changed and release engineering's PATH points
at a older zip that we don't support.
- there is a bug in jar where it is making an assumption it should
not.
If it is the former, then please categorize this under build.
Steps to reproduce the problem:
----------
$ /usr/local/java/jdk1.2/solaris/bin/jar -J-version
java version "1.2fcs"
Classic VM (build JDK-1.2fcs-I, green threads, sunwjit)
$ mkdir /tmp/test
$ cd /tmp/test
$ touch foo
$ cp /usr/local/java/jdk1.2/solaris/src.jar .
$ /usr/local/java/jdk1.2/solaris/bin/jar uvf src.jar foo
java.util.zip.ZipException: invalid entry compressed size (expected 9823 but got 9821 bytes)
at java.util.zip.ZipOutputStream.closeEntry(Compiled Code)
at java.util.zip.ZipOutputStream.putNextEntry(Compiled Code)
at java.util.jar.JarOutputStream.putNextEntry(Compiled Code)
at sun.tools.jar.Main.update(Compiled Code)
at sun.tools.jar.Main.run(Compiled Code)
at sun.tools.jar.Main.main(Compiled Code)
$ cp /usr/local/java/jdk1.2/solaris/jre/lib/rt.jar .
$ /usr/local/java/jdk1.2/solaris/bin/jar uvf rt.jar foo
adding: foo (in=0) (out=0) (stored 0%)
----------
anand.palaniswamy@Eng 1998-09-10
but updating a file into rt.jar works. This is probably because src.jar
is created with zip but rt.jar is created with jar. Note that on Win32
we create src.jar with jar as well, so it is only the Solaris src.jar
that fails. It would be good to know why updating a zip file created by
zip fails -- it could either be:
- the zip format has changed and release engineering's PATH points
at a older zip that we don't support.
- there is a bug in jar where it is making an assumption it should
not.
If it is the former, then please categorize this under build.
Steps to reproduce the problem:
----------
$ /usr/local/java/jdk1.2/solaris/bin/jar -J-version
java version "1.2fcs"
Classic VM (build JDK-1.2fcs-I, green threads, sunwjit)
$ mkdir /tmp/test
$ cd /tmp/test
$ touch foo
$ cp /usr/local/java/jdk1.2/solaris/src.jar .
$ /usr/local/java/jdk1.2/solaris/bin/jar uvf src.jar foo
java.util.zip.ZipException: invalid entry compressed size (expected 9823 but got 9821 bytes)
at java.util.zip.ZipOutputStream.closeEntry(Compiled Code)
at java.util.zip.ZipOutputStream.putNextEntry(Compiled Code)
at java.util.jar.JarOutputStream.putNextEntry(Compiled Code)
at sun.tools.jar.Main.update(Compiled Code)
at sun.tools.jar.Main.run(Compiled Code)
at sun.tools.jar.Main.main(Compiled Code)
$ cp /usr/local/java/jdk1.2/solaris/jre/lib/rt.jar .
$ /usr/local/java/jdk1.2/solaris/bin/jar uvf rt.jar foo
adding: foo (in=0) (out=0) (stored 0%)
----------
anand.palaniswamy@Eng 1998-09-10
- relates to
-
JDK-8253952 Refine ZipOutputStream.putNextEntry() to recalculate ZipEntry's compressed size
-
- Resolved
-