wrandelshofer / FastDoubleParser

A Java port of Daniel Lemire's fast_float project
MIT License
166 stars 17 forks source link

1.0.0 release only supports very recent JVMs #79

Closed pjfanning closed 9 months ago

pjfanning commented 10 months ago

Jackson still supports Java 8 but fastdoubleparser has at least some classes that have class file major version 66 - might be java 22

Jackson built fine with fastdoubleparser 0.9.0.

This could be a shortcoming of maven plugins - that don't know about Java 22. In fairness, Java 22 is only early access and many build tools really struggle to keep up.

Error:  Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.5.1:shade (shade-jackson-core) on project jackson-core: Error creating shaded jar: Problem shading JAR /home/runner/.m2/repository/ch/randelshofer/fastdoubleparser/1.0.0/fastdoubleparser-1.0.0.jar entry META-INF/versions/22/ch/randelshofer/fastdoubleparser/FastDoubleSwar.class: java.lang.IllegalArgumentException: Unsupported class file major version 66 

Edit: This seems to be a shortcoming of maven-shade-plugin but I think I have managed to work around it by excluding the java 22 classes that are in META-INF/versions/22/ch/randelshofer/fastdoubleparser

pjfanning commented 10 months ago

@wrandelshofer feel free to ignore this (or close it) - https://github.com/FasterXML/jackson-core/pull/1163 has worked around this issue

wrandelshofer commented 9 months ago

Oh, I am surprised that 1.0.0 does not work.

fastdoubleparser is a multi-release Jar. Supporting JDK 8 through 22. Even older releases included compiled classes for early-access JVMs. So far, these worked for me.

pjfanning commented 9 months ago

A lot of build tools like maven-shade-plugin and gradle struggle to maintain support for new JDKs - https://github.com/FasterXML/jackson-core/issues/955 is another report.

I don't know why they can't just ignore classes in META-INF/versions/x where the x is a version newer than they support.

wrandelshofer commented 9 months ago

Closing this, because this is a bug in older versions of the Gradle build system. Older versions of Gradle can not handle multi-release Jars properly. Because they attempt to instrument classes in the META-INF/versions folders that are not supported by the JVM on which Gradle runs. See https://github.com/gradle/gradle/issues/24390