jenkins启动构建 neither the java_home nor the jre_home environment variable is defined

本文介绍了在Jenkins构建过程中遇到的'neither the java_home nor the jre_home environment variable is defined'错误。问题根源在于Jenkins未能正确识别Tomcat的JDK配置。为解决此问题,作者将JDK/bin目录软链接到/usr/bin/,并重启Jenkins,随后构建成功。此外,作者还强调在Jenkins配置中也需要设置JDK。

描述:构建时文件没有传输过去,控制台报以下错误

SSH: Connecting from host [localhost.localdomain]
SSH: Connecting with configuration [tomcat-服务器] ...
SSH: EXEC: STDOUT/STDERR from command [/webdir/tomcat/bin/startup.sh] ...
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
SSH: EXEC: completed after 201 ms
SSH: Disconnecting configuration [tomcat-服务器] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [1]]
Parsing POMs

原因:找不到tomcat服务器的jdk,实际上tomcat已经配好环境变量了,怀疑是jenkins没找到,故将jdk/bin目录下的文件链接到/usr/bin/,重启Jenkins,正常使用

ln -s /usr/local/jdk1.8/bin/* /usr/bin/

 再次运行,成功

SSH: Connecting from host [localhost.localdomain]
SSH: Connecting with configuration [tomcat-服务器] ...
SSH: EXEC: STDOUT/STDERR from command 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值