1. 程式人生 > >Linux下tomcat啟動Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of

Linux下tomcat啟動Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of

環境 技術分享 variable ava eight 錯誤 mbr bin p s

在linux下安裝好tomcat啟動時報如下錯誤:

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

原因:找不到jdk或者jre路徑。

解決辦法:在setclasspath.bat的開頭聲明環境變量,打開tomcat的bin目錄下面的setclasspath.sh,添加紅色部分,路徑修改為自己機器jdk和jre路徑即可。

export JAVA_HOME=/opt/zimbra/jdk1.6.0_31
export JRE_HOME=/opt/zimbra/jdk1.6.0_31/jre

技術分享圖片

Linux下tomcat啟動Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of