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

后端 未结 10 849
傲寒
傲寒 2020-12-11 14:39

I want to use java9 on my gradle project inside eclipse oxygen. When I run:

Run as> Gradle Test on  GreeterTest.java

with the followin

10条回答
  •  时光取名叫无心
    2020-12-11 15:06

    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.

提交回复
热议问题