Jenkins啓動Tomcat時提示Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

 

 

Jenkins構建提示:java

[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 programbash

解決辦法:this

  方法1:直接在在腳本前添加java環境變量spa

  方法2:若是是在 /etc/profile 中導入的環境變量,那麼在/root/.bashrc中加入相同環境變量code

  

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
相關文章
相關標籤/搜索