gradle java9 Could not target platform: 'Java SE 9' using tool chain: 'JDK 8 (1.8)'

You should probably try to update your JAVA_HOME in system variables and Java version used in eclipse to be consistent to


In MacOSX, something like :

JAVA_HOME = /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin

As informed in comments, the default path on Linux would be :


From what I can see, it is the Gradle version issue. (Gradle and Java 9 compatibility issue).

You need to upgrade the wrapper to 4.3.1, cli ref:

# upgrade Gradle to 4.3.1 
gradle wrapper --gradle-version 4.3.1 # not ./gradlew

Let me know if that works.

stein korsveien

I changed the java_home and upgraded Gradle. Now it is working.

For me the problem was that I used

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_10
    targetCompatibility JavaVersion.VERSION_1_10

but the project was configured for Java 1.8. So I changed these to 1_8 and it works.