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

JAR file validation fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 17.0.2, 18, 19
    • tools
    • None
    • jar

      Running "jar --validate --file JAR-FILE" may lead to "java.lang.UnsupportedOperationException: This feature requires ASM..." exceptions. Find details in stack trace attached at the end of this description.

      The underlying reason is a usage of "Opcodes.ASM7" in the sun.tools.jar.FingerPrint class.

      Find a minimal reproducer at https://github.com/sormuras/JDK-8282446

      {{
      java.lang.UnsupportedOperationException: This feature requires ASM9_EXPERIMENTAL
              at java.base/jdk.internal.org.objectweb.asm.ClassVisitor.visitPermittedSubclassExperimental(ClassVisitor.java:299)
              at java.base/jdk.internal.org.objectweb.asm.ClassReader.accept(ClassReader.java:715)
              at java.base/jdk.internal.org.objectweb.asm.ClassReader.accept(ClassReader.java:432)
              at jdk.jartool/sun.tools.jar.FingerPrint.getClassAttributes(FingerPrint.java:165)
              at jdk.jartool/sun.tools.jar.FingerPrint.<init>(FingerPrint.java:81)
      }}

      {{
      java.lang.UnsupportedOperationException: This feature requires ASM8
              at java.base/jdk.internal.org.objectweb.asm.ClassVisitor.visitRecordComponent(ClassVisitor.java:338)
              at java.base/jdk.internal.org.objectweb.asm.ClassReader.readRecordComponent(ClassReader.java:962)
              at java.base/jdk.internal.org.objectweb.asm.ClassReader.accept(ClassReader.java:740)
              at java.base/jdk.internal.org.objectweb.asm.ClassReader.accept(ClassReader.java:432)
              at jdk.jartool/sun.tools.jar.FingerPrint.getClassAttributes(FingerPrint.java:165)
              at jdk.jartool/sun.tools.jar.FingerPrint.<init>(FingerPrint.java:81)
      }}

            lancea Lance Andersen
            cstein Christian Stein
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: