linux 啟動(dòng) 關(guān)閉是 遇到的 問(wèn)題

在linux下安裝好tomcat啟動(dòng)時(shí)報(bào)如下錯(cuò)誤:

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

原因:找不到j(luò)dk或者jre路徑。

解決辦法:在setclasspath.bat的開頭聲明環(huán)境變量,打開tomcat的bin目錄下面的setclasspath.sh,添加粗體部分,路徑修改為自己機(jī)器jdk和jre路徑即可

# -----------------------------------------------------------------------------

#? Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings

#? are valid and consistent with the selected start-up options and set up the

#? endorsed directory.

# -----------------------------------------------------------------------------

export JAVA_HOME=/usr/java/jdk1.8.0_151

export JRE_HOME=/usr/java/jdk1.8.0_151/jre

"setclasspath.sh" 99L, 3762C written

[root@iZ2ze6cj9rrq7y40sjtli9Z bin]# cd ..

[root@iZ2ze6cj9rrq7y40sjtli9Z apache-tomcat-8.5.24]# ls

bin? lib? ? ? logs? ? RELEASE-NOTES? temp? ? work

conf? LICENSE? NOTICE? RUNNING.txt? ? webapps

[root@iZ2ze6cj9rrq7y40sjtli9Z apache-tomcat-8.5.24]# cd bin/

[root@iZ2ze6cj9rrq7y40sjtli9Z bin]# ls

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容