Open sormuras opened 2 years ago
Did the following steps:
application
pluginberyx.jlink
pluginSame error. However if the bnd plugin is commented out I get a different error
$ jar --validate --file build/libs/jdktools-17.0.4.jar
java.lang.UnsupportedOperationException: This feature requires ASM8
@sormuras Nope, it should only be released features...no experimental so far...at least that's the settings in Intellij, so I guess it would also complain if there would be experimental features used. I also cleaned it up a bit, still contained unused stuff but I get the same error that @aalmiray mentioned..."This feature requires ASM8"
I've created a complete new project and only copied the .java files using no gradle plugins at all...and it leads to the same error "This feature requires ASM8". Also replace the one record that I use by a class did not fix it, so at the moment I have no idea why it fails...
Tried the following steps with the source from this project:
javac --module eu.hansolo.jdktools --module-source-path eu.hansolo.jdktools=src\main\java -d out/classes
jar --create --file out/eu.hansolo.jdktools.jar -C out/classes/eu.hansolo.jdktools .
jar --validate --file out/eu.hansolo.jdktools.jar
And it also produces:
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)
at jdk.jartool/sun.tools.jar.Validator.getFingerPrint(Validator.java:142)
Something's off here... 🤔
Took the jdk11 branch and did the same...and it works...
"Getting closer..."
I think I have something...I've compiled the jdk11 branch with Zulu 11 and it works...then I compiled the jdk11 branch with Zulu 17 and it fails...
Will now try with Temurin 17.0.2...
Same thing...with Temurin 17.0.2 and the main branch it also fails...
This might be a change in later JDKs as it works on 11
I will now give 16.0.2 a try...
Created https://bugs.openjdk.java.net/browse/JDK-8282446 to track this JDK-related issue.
16.0.2 also fails...
Removing all JDK17 syntax makes jar --validate
work. It's one of:
Yep I've already tried to remove record and Stream.toList() so it seems to be the switch...will try...
And I guess the comma separated case statements are the problem...
Yes, they might be. There's a lot of them (easy on the sugar boy 😏 )
It's all of those not covered by Opcodes.ASM7
: https://github.com/openjdk/jdk/blob/master/src/jdk.jartool/share/classes/sun/tools/jar/FingerPrint.java#L246-L248
Hi Gerrit,
Running
jar --validate --file jdktools-17.0.4.jar
usingjdk
of JDK 17 (17.0.1, 17.0.2), 18 RC, and 19-ea yields:I am not sure what the underlying issue is.
It seems to related to experimental/preview features of ASM. Does
jdktools
use incubating and/or preview features?