bjornharrtell / jts2geojson

JTS from/to GeoJSON converter for Java
MIT License
141 stars 57 forks source link

GeoJSONWriter compiled for Java 11 (class file version 55.0) #39

Closed fmiguelez closed 4 years ago

fmiguelez commented 4 years ago

Latest closed version 0.14.1 is supposed to be compatible with Java 8. In pom.xml:

`

org.apache.maven.plugins
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

`

However when I try to instantiate from tests GeoJSONWriter I get this error:

java.lang.UnsupportedClassVersionError: org/wololo/jts2geojson/GeoJSONWriter has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2583) at java.lang.Class.getDeclaredFields(Class.java:1916) at org.junit.runners.model.TestClass.getSortedDeclaredFields(TestClass.java:77) at org.junit.runners.model.TestClass.scanAnnotatedMembers(TestClass.java:70) at org.junit.runners.model.TestClass.(TestClass.java:57) at org.junit.runners.ParentRunner.createTestClass(ParentRunner.java:88) at org.junit.runners.ParentRunner.(ParentRunner.java:83) at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65) at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:525) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

Was version incorrectly generated?

bjornharrtell commented 4 years ago

Possibly but what do you mean with "closed version" and do you know if 0.14.2 and 0.14.3 also are incompatible with Java 8?

fmiguelez commented 4 years ago

I just realized that 0.14.1 was not the latests, my bad. With 0.14.3 it works perfectly, thanks. Shall I delete the ticket?

fmiguelez commented 4 years ago

Version 0.14.1 was not latest but 0.14.3, that works perfectly with Java 8