Could not find tools.jar when build gradle project

Posted zytz

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

技术图片

 

以上是关于Could not find tools.jar when build gradle project的主要内容,如果未能解决你的问题,请参考以下文章

使用 Gradle 编译 Java 项目时报错: Could not find Tools.jar

STS报could not find tools.jar in the active JRE

Error: Could not find or load main class Test

could not find the required version of the Java(TM)2 Runtime Environment in '(null)'的解决办法。

sts安装出现could not find jar:file解决办法,could not find jar:file,sts安装

CMake Error: Could not find CMAKE_ROOT !!!