Gradle - Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)'

Vasiliy Vlasov :

I am trying to import Gradle project in Intellij Idea with local Gradle distrib and getting stacktrace with the following message: Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)'. Could anyone explain please what could be the reason?

Vasiliy Vlasov :

Finally I imported my Gradle project. These are the steps:

  1. I switched from local Gradle distrib to Intellij Idea Gradle Wrapper (gradle-2.14).
  2. I pointed system variable JAVA_HOME to JDK 8 (it was 7th previously) as I had figured out by experiments that Gradle Wrapper could process the project with JDK 8 only.
  3. I deleted previously manually created file gradle.properties (with org.gradle.java.homevariable) in windows user .gradle directory as, I guessed, it didn't bring any additional value to Gradle.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=423985&siteId=1