Plugin fails with OpenJDK 8
artdent opened this issue · 4 comments
I'm using gradle-errorprone-plugin on an Android project. When I try to compile using the default JDK that ships with Ubuntu 16.04, the plugin throws an exception:
java.lang.NullPointerException
at net.ltgt.gradle.errorprone.ErrorProneCompiler$SelfFirstClassLoader.<clinit>(ErrorProneCompiler.java:81)
I've attached a more complete stacktrace, a result of running ./gradlew compileStageDebugJavaWithJavac --debug --stacktrace
: gradle-output.txt
The fix was to install the Oracle JDK 1.8, but I figured I'd at least file a bug as documentation, or in case there's some way to check for the JDK version and either do something else or just throw a more helpful exception.
My app/build.gradle is pretty standard:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
}
}
apply plugin: 'net.ltgt.errorprone'
OpenJDK version:
~$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
Oracle JDK version:
~$ java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
Thanks!
Which version of Gradle are you using? I can't reproduce on my own projects using 2.12 or 2.13 (granted, I don't do Android, so maybe it's related to Android builds?) Do you have a small repro case?
I'm using Gradle 2.10, so that could be it. I think the Gradle version is tied to the version of the Android development tools...
I'll try to set up a repro case when I get the chance.
Ping.
(been nearly 3 months)