Jenkins故障Java 12 OpenJDK-JAVA_HOME环境变量未正确定义 [英] Jenkins failure Java 12 OpenJDK - The JAVA_HOME environment variable is not defined correctly

查看:385
本文介绍了Jenkins故障Java 12 OpenJDK-JAVA_HOME环境变量未正确定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

配置Jenkins(2.121.3)使用",在执行构建时使用下载二进制存档的URL"会产生以下错误:

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:

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

如何解决此问题?

推荐答案

tar文件中有一个名为jdk-12的目录,因此当Jenkins提取该目录时,命名的jdk文件夹不是bin目录的直接父目录.

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.

/var/jenkins_home/tools/hudson.model.JDK/Java12/jdk-12/bin

应该是

/var/jenkins_home/tools/hudson.model.JDK/Java12/bin

要解决此问题,请提取tar文件,进入jdk-12文件夹tar czf openjdk-12_linux-x64_bin.tar.gz *,将其上传到Jenkins可以访问的位置,然后将该URL放入全局工具配置- > JDK安装...安装程序.

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.

这篇关于Jenkins故障Java 12 OpenJDK-JAVA_HOME环境变量未正确定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆