question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

does Error Prone v2.0.6 require Java 1.8?

See original GitHub issue

Hi 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:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
phinehaszcommented, Jul 9, 2019

Right, 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.

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 amateur

0reactions
cushoncommented, Oct 28, 2015

Right, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation - Error Prone
Our goal is to make it simple to add Error Prone checks to your existing Java compilation. Please note that Error Prone must...
Read more >
Error prone disable check, Error prone installation, Errorprone java ...
We turned Error Prone on by default but you can easily turn it off by using the ... through -Xbootclasspath/p: . does Error...
Read more >
Persistent error "require java version 1.8 or higher" when ...
I am having a problem when I try to install a Digital Experience Collector. I am following the steps described in this link:...
Read more >
Veritas Data Insight Third-Party Attributions Guide
HTTP-Proxy-Servlet 1.8. Guava: Google Core Libraries for Java v30.0. firebug-lite 1.4. Apache Directory LDAP API DSML Parser 1.0.2. Dropwizard Request ...
Read more >
An evaluation of flexible macroblock ordering in error-prone ...
Find, read and cite all the research you need on ResearchGate. ... in H.264/AVC, is made by analyzing its costs and gains in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found