FasterXML / FasterXML/jackson-core

JDK compatibility issues with jackson-core 2.14 and later due to Multi-Release (MR) jars

Aperta
#1,210 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub
will-not-fix
Lingua principale
Java
Stelle
2.4k
Fork
928
Merge medio
2g 18h
PR unite (30g)
24

Descrizione

The time that the jackson-core library switched from using its own copy of the `fasterdoubleparser` code to the actual library this can cause JDK incompatibilities. The problem manifests itself if you take any newer version of the jackson-core libraries 2.14 or better and you need to do any type of dependency shading. If you do - the `fasterdoubleparser` uses a technique of putting all the class files across different JDK's well beyond the advertised JDK8 compatibility (https://github.com/FasterXML/jackson-core?tab=readme-ov-file#jdk) via the Maven assembly plugin (https://github.com/wrandelshofer/FastDoubleParser/blob/main/fastdoubleparser/src/assembly/mrjar.xml).

When shading you end up getting all the class files for all the`fasterdoubleparser` supported JDK's and if you aren't using the highest JDK version possible you will run into problems like this:

java.lang.IllegalArgumentException: Unsupported class file major version 63
at shadow.org.objectweb.asm.ClassReader.(ClassReader.java:199)
at shadow.org.objectweb.asm.ClassReader.(ClassReader.java:180)
at shadow.org.objectweb.asm.ClassReader.(ClassReader.java:166)
at shadow.org.objectweb.asm.ClassReader.(ClassReader.java:287)

For example I am using JDK17 and the Gradle Shadow plugin. The ASM library aborts when it finds a class file that isn't inline with the JDK you are running.

This is easily reproducible if you use the Gradle Shadow plugin or the Maven Shade plugin and use JDK17 and include the jackson-core 2.15.2 as a dependency for example.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.