[英]Jenkins failure Java 12 OpenJDK - The JAVA_HOME environment variable is not defined correctly
Configuring Jenkins (2.121.3) to use JDK 12 in the Global Tool Configuration->JDK installations... menu using "Download URL for binary archive" produces the following error when performing a build:配置 Jenkins (2.121.3) 以在全局工具配置->JDK 安装...菜单中使用JDK 12使用“下载二进制存档的 URL”在执行构建时会产生以下错误:
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
How can I resolve this issue?我该如何解决这个问题?
The tar file has a directory called jdk-12 inside it, so when Jenkins extracts it, the named jdk folder is not the direct parent of the bin directory. tar 文件里面有一个叫 jdk-12 的目录,所以 Jenkins 解压的时候,命名的 jdk 文件夹并不是 bin 目录的直接父目录。
/var/jenkins_home/tools/hudson.model.JDK/Java12/jdk-12/bin
should be应该
/var/jenkins_home/tools/hudson.model.JDK/Java12/bin
To fix this, extract the tar file, go into the jdk-12 folder, tar czf openjdk-12_linux-x64_bin.tar.gz *
, upload it somewhere accessible to Jenkins and put the URL in the "Download URL for binary archive" field in the Global Tool Configuration->JDK installations... installer.要解决此问题,请解压缩 tar 文件,进入 jdk-12 文件夹,
tar czf openjdk-12_linux-x64_bin.tar.gz *
,将其上传到 Jenkins 可访问的位置,并将 URL 放在“下载二进制存档的 URL”字段中在全局工具配置-> JDK 安装...安装程序中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.