簡體   English   中英

Gradle 構建工具。jar 未找到

[英]Gradle build tools.jar not found

我正在嘗試在 RHEL EC2 機器中構建 spring 引導應用程序。我在 gradle 構建中找不到“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 路徑

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM