The solution when gradle reports jdk mismatch

When building a project with gradle, a jdk mismatch error may occur, when the following error occurs:

Execution failed for task ':java-app:compileJava'.
> Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)'.

The solution is to add a command that defines the jdk version after the command:

gradle uploadArchives  -Dorg.gradle.java.home=D:/glzf/Java/jdk1.8.0_20

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324398641&siteId=291194637