【发布时间】:2020-03-15 19:38:30
【问题描述】:
我正在尝试在 RHEL EC2 机器中构建 Spring Boot 应用程序。我在 gradle build 中找不到“tools.jar”
readlink -f $(which java)
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-2.el8_1.x86_64/jre/bin/java
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-2.el8_1.x86_64/jre
echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-2.el8_1.x86_64/jre
但是当我尝试构建时,我遇到了错误
$gradle build
> 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 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-
2.el8_1.x86_64/jre contains a valid JDK installation.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more
log output. Run with --scan to get full insights.
【问题讨论】:
-
你安装的是 jre 而不是 jdk。
-
@ M. Deinum 我安装了 JDK 我应该在导出命令中给出哪个路径?
标签: java spring-boot gradle amazon-ec2 build.gradle