does Error Prone v2.0.6 require Java 1.8?
See original GitHub issueHi all –
Last night, our builds have started failing with the following error:
09:55:36 :ServiceInterfaces:compileJava FAILED
09:55:36
09:55:36 FAILURE: Build failed with an exception.
09:55:36
09:55:36 * What went wrong:
09:55:36 Execution failed for task ':ServiceInterfaces:compileJava'.
09:55:36 > javax/tools/DiagnosticListener : Unsupported major.minor version 52.0
09:55:36
09:55:36 * Try:
09:55:36 Run with --info or --debug option to get more log output.
09:55:36
09:55:36 * Exception is:
09:55:36 org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':ServiceInterfaces:compileJava'.
09:55:36 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
09:55:36 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
[.....]
09:55:36 Caused by: java.lang.UnsupportedClassVersionError: javax/tools/DiagnosticListener : Unsupported major.minor version 52.0
09:55:36 at java.lang.ClassLoader.defineClass1(Native Method)
09:55:36 at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
09:55:36 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
09:55:36 at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
09:55:36 at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
09:55:36 at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
09:55:36 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
09:55:36 at java.security.AccessController.doPrivileged(Native Method)
09:55:36 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
09:55:36 at net.ltgt.gradle.errorprone.ErrorProneCompiler$SelfFirstClassLoader.loadClass(ErrorProneCompiler.java:106)
09:55:36 at net.ltgt.gradle.errorprone.ErrorProneCompiler$SelfFirstClassLoader.loadClass(ErrorProneCompiler.java:97)
09:55:36 at java.lang.Class.getDeclaredMethods0(Native Method)
09:55:36 at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
09:55:36 at java.lang.Class.getMethod0(Class.java:2774)
09:55:36 at java.lang.Class.getMethod(Class.java:1663)
09:55:36 at net.ltgt.gradle.errorprone.ErrorProneCompiler.execute(ErrorProneCompiler.java:56)
09:55:36 at net.ltgt.gradle.errorprone.ErrorProneCompiler.execute(ErrorProneCompiler.java:25)
09:55:36 at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:101)
09:55:36 at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:50)
09:55:36 at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:36)
09:55:36 at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)
09:55:36 at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
09:55:36 at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:157)
09:55:36 at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:137)
09:55:36 at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:91)
09:55:36 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:55:36 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
09:55:36 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:55:36 at java.lang.reflect.Method.invoke(Method.java:606)
09:55:36 at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
09:55:36 at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:243)
09:55:36 at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
09:55:36 at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:230)
09:55:36 at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
09:55:36 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
09:55:36 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
09:55:36 ... 60 more
On investigating, it appears that this started happening shortly after the release of v2.0.6. I also note the following commit in master: https://github.com/google/error-prone/commit/425b9c167800332da711299e7a7ca8211f728889
‘Turn down travis JDK7 build We only support JDK8 as of 884eec7.’
Is this for the internal build of the Error Prone JAR, or for users as well? Because if the latter, that should be documented, and arguably requires a major version bump IMO. If the former, however, I guess the build might need to use ‘-target 1.7’ or equivalent so that it correctly produces 1.7-compatible class files.
PS: aside from that, thanks for Error Prone! It’s really helped our code quality and we appreciate it! 😉
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top GitHub Comments
I want to set to target Java 7 , how can I modify my pom.xml? I just know
source>7</source> <target>7</target>
But I do not know how to set bootclasspath, and set what here? I cannot find in error-prone info & wiki any more. I am a amateurRight, if you’re able to run JDK8 on your dev machine but still need to use the Java 7 language and deploy to JDK7, you can use the latest version of Error Prone. Just make sure
-source
/-target
/-bootclasspath
is set to target Java 7.