Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4172498

"jar uvf" does not work with has problems with certain zip files.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.2.0
    • 1.2.0
    • tools
    • None
    • jar
    • 1.2fcs
    • sparc
    • solaris_2.5.1
    • Verified

      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

            zlisunw Zhenghua Li (Inactive)
            apalanissunw Anand Palaniswamy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: