Jenkins构建提示:

[SSH] executing...
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
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

解决办法:

  方法1:直接在在脚本前添加java环境变量

Jenkins启动Tomcat时提示Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

方法2:如果是在 /etc/profile 中导入的环境变量,那么在/root/.bashrc中加入相同环境变量

1

2

3

4

export JAVA_HOME=/root/jdk/jdk1.8.0_171

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export JRE_HOME=$JAVA_HOME/jre

 

说明:目前jenkins构建远程启用tomcat,使用的方法2。

相关文章:

  • 2022-01-16
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-06
  • 2021-05-18
相关资源
相似解决方案