Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation

后端 未结 16 2187
天命终不由人
天命终不由人 2020-12-01 02:50

Even though I manually configured JDK project structure file/Project structure it still shows this error FAILURE: Build failed with an exception.

`What went wrong:

16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 03:02

    The problem is your gradle build is not finding the JAVA_HOME path or JDK folder. So, you could declare the path in gradle.properties like org.gradle.java.home=C:\Program Files\Java\[or yours jdk folder name].

    Use this guide for using gradle.properties.

    Or (and I prefer this solution) include JAVA_HOME path in systmem variables and restart CMD.

提交回复
热议问题