描述:构建时文件没有传输过去,控制台报以下错误
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

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

被折叠的 条评论
为什么被折叠?



