Could not find tools.jar when build gradle project


參考網址:https://stackoverflow.com/questions/45456210/could-not-find-tools-jar-when-build-gradle-project

執行:

gradlew.bat clean build -x test

出錯信息:

Parallel execution with configuration on demand is an incubating feature.
> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not find tools.jar. Please check that D:\Java\jre contains a valid JDK installation.

解決:

在根目錄下新建一個gradle.properties,在其中加上一行即可:

org.gradle.java.home=C:/path/to/your/jdk

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM