We Are Going To Discuss About Gradle – Could not target platform: ‘Java SE 8’ using tool chain: ‘JDK 7 (1.7)’. So lets Start this Java Article.
Gradle – Could not target platform: ‘Java SE 8’ using tool chain: ‘JDK 7 (1.7)’
- Gradle – Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)'
This is what worked for me (Intellij Idea 2018.1.2):
1) Navigate to: File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
2) Gradle JVM: change to version 1.8
3) Re-run the gradle task - Gradle – Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)'
This is what worked for me (Intellij Idea 2018.1.2):
1) Navigate to: File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
2) Gradle JVM: change to version 1.8
3) Re-run the gradle task
Solution 1
This is what worked for me (Intellij Idea 2018.1.2):
1) Navigate to: File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
2) Gradle JVM: change to version 1.8
3) Re-run the gradle task
Original Author Mahesh Of This Content
Solution 2
For IntelliJ 2019:
Intellij IDEA -> Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JVM
Select correct version.
Original Author François Gaudin Of This Content
Solution 3
For IntelliJ 2019, JDK 13 and gRPC:
Intellij IDEA -> Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JVM
and Select correct version.
you might also have to adding below line in your build.gradle dependencies
compileOnly group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
Original Author Aheza Desire Of This Content
Solution 4
Finally I imported my Gradle project. These are the steps:
- I switched from local Gradle distrib to Intellij Idea Gradle Wrapper
(gradle-2.14). - 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. - I deleted previously manually created file gradle.properties (with
org.gradle.java.home
variable) in windows user .gradle directory
as, I guessed, it didn’t bring any additional value to Gradle.
Original Author Aheza Desire Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.