JDK 8 compatibility to compile metric-core module (4.2.x)
mcfongtw opened this issue · 1 comments
mcfongtw commented
When I attempt to compile metric-core on the latest release/4.2.x with JDK 1.8.312, maven complains the following error. Is the project no longer compatible with Java 8 and need to move forward to Java 9/11?
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] An exception has occurred in the compiler (1.8.0_312). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.UnsupportedClassVersionError: com/google/errorprone/ErrorProneJavacPlugin 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:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.tools.javac.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:255)
at com.sun.tools.javac.util.ServiceLoader$1.next(ServiceLoader.java:337)
at com.sun.tools.javac.main.Main.compile(Main.java:463)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
at com.sun.tools.javac.Main.main(Main.java:42)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.788 s
[INFO] Finished at: 2022-07-02T21:51:27-07:00
[INFO] ------------------------------------------------------------------------
joschi commented
@mcfongtw You need Java 11 to compile Dropwizard Metrics 4.2.x (because of Error Prone since Error Prone 2.11.0 and Dropwizard Metrics 4.2.9 #2419) but can still use it with Java 8.