gpt4 book ai didi

java - 找不到 Gradle 构建工具.jar

转载 作者:太空宇宙 更新时间:2023-11-04 09:16:08 25 4
gpt4 key购买 nike

我正在尝试在 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.

最佳答案

我安装了 jdk 并运行了 $yum install java-1.8.0-openjdk-devel。使用相同的 jre 路径成功构建后

关于java - 找不到 Gradle 构建工具.jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58948373/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com