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?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
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
The following worked for me:
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
For IntelliJ 2019:
Intellij IDEA -> Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle JVM
Select correct version.
Since I had to compile some source with 7 compatibility, because of some legacy system and ran into the same problem. I found out that in the gradle configuration there where two options set to java 8
switching these to 1.7 solved the problem for me, keeping JAVA_HOME pointing to the installed JDK-7
Finally I imported my Gradle project. These are the steps:
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.org.gradle.java.home
variable) in windows user .gradle directory as, I guessed, it didn't bring any additional value to Gradle.