Closed alvindizon closed 3 years ago
The problem is that the compiled artifacts are at Java 11 level (version 55). I don't know why that happens because I've specified I want Java 8 level at https://github.com/bjornharrtell/jts2geojson/blob/b305a757b2a67c34286560e501bab763fd4c9c43/pom.xml#L86-L87.
I have no interest in Java 8 compat myself but contributions are welcome.
I've tried the following:
java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JavaType
...
...
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.JavaType
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
This occurs at a line where GeoJSONFactory.create(jsonString) as FeatureCollection
is used.
@alvindizon does it work with no 2?
It should be possible to produce a Java 8 class level with Java 11 and that is actually the expected result with current pom.xml but must be something wrong with it.
Hi @bjornharrtell , with #2, all checks passed but haven't really tested in-app to see if it works normally, but I'd expect it to work fine. Regarding the pom.xml, I agree that the current config should be enough, but I'm still investigating why it produces an incompatible artifact. Since maven-compiler-plugin
is version 3.8.1 I've tried to use <release>
instead of <source>
and <target>
but didn't work as well:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>8</release>
</configuration>
</plugin>
I rolled back to a previous release and checked out v0.14.3 (commit aed4ba4), and tried to generate a JAR using Java 11--I generated a JAR that produces the same Bad class file
error. Could it be that you used Java 8 previously when releasing 0.14.3 and switched to Java 11 in your machine?
@alvindizon yes many years ago I used Java 8. :P
I'm also experiencing this issue - I will provide an update once I have more info
Looks like https://github.com/bjornharrtell/jts2geojson/commit/d9ea8827c0db2e0a8897fcaa04e57503e3654876 helps. Dont ask me why... but I'll cut a new release in a few hours.
super - thanks for the rapid response - most likely a travis/devop-sy issue
Just checked out 0.16.1 and the bad class file
error encountered in our lint check has gone away, however unit tests throw a different error (NoClassDefFoundError: com/fasterxml/jackson/databind/JavaType
) but that's not related to this issue, so I'm closing this issue now. Thanks @bjornharrtell
For our Android app, on upgrade to version 0.16.0, our lint check encountered this error:
This is a snippet of the generated java file that was pointed to by the logs (edited to hide details):
Not sure how to approach this, your input on what's happening would be much appreciated. Thanks