异常现象:
jenkins 远程启动tomcat报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
解决方案:
在开始脚本前面添加java的变量
export JAVA_HOME=/app/jdk1.8.0_144
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=${JAVA_HOME}/bin:$PATH
![](https://img2020.cnblogs.com/blog/1669759/202105/1669759-20210513150314870-1805441218.png)