提问人:Sachin Sheelavant 提问时间:11/17/2023 更新时间:11/17/2023 访问量:20
当与另一个项目一起使用的相同脚本工作正常时,Jenkins 管道找不到 Java
Jenkins pipeline unable to find Java when same script used with another project is working fine
问:
我收到以下错误
[INFO] Changes detected - recompiling the module! :dependency
[INFO] Compiling 7 source files with javac [debug target 1.8] to target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.513 s
[INFO] Finished at: 2023-11-16T05:23:59Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project project-name: Fatal error compiling: tools.jar not found: /usr/lib/jvm/java-8-amazon-corretto/../lib/tools.jar -> [Help 1]
我检查了管道中的 java 版本,它正确显示如下
[Pipeline] sh
+ java -version
openjdk version "1.8.0_392"
OpenJDK Runtime Environment Corretto-8.392.08.1 (build 1.8.0_392-b08)
OpenJDK 64-Bit Server VM Corretto-8.392.08.1 (build 25.392-b08, mixed mode)
[Pipeline] sh
+ javac -version
javac 1.8.0_392
可能是什么问题?
答: 暂无答案
评论
../lib/tools.jar
/usr/lib/jvm/lib/tools.jar