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

后端 未结 10 873
傲寒
傲寒 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:11

    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.

提交回复
热议问题