1. 程式人生 > 其它 >linux篇-tomcat:Cannot find /usr/local/tomcat1/bin/setclasspath.sh

linux篇-tomcat:Cannot find /usr/local/tomcat1/bin/setclasspath.sh

首先看下報錯程式碼:

Cannot find /usr/local/tomcat1/bin/setclasspath.sh
This file is needed to run this program

         這個可能是沒有在 /etc/profile 中配置環境,這是第一種可能;如果是這種情況的話,可以這樣做:
vi /etc/profile

並在檔案末尾加上

export CATALINA_HOME=/usr/local/tomcat
export CATALINA_BASE=/usr/local/tomcat

最後 source /etc/profile 使剛才的配置生效就可以了;


    第二種可能,是bin目錄下的檔案許可權不夠,11一下,然後給bin目錄下的所有檔案增加執行許可權:

chmod a+x *


 然後的話,再啟動一下Tomcat試試,

        /usr/local/tomcat/bin/startup.sh

位址列中輸入“ htttp:// IP地址 :8080”,如果能看到湯姆貓,說明就成功了,建議多殺幾次程序在重啟,觀察錯誤是否繼續產生,務必保持配置檔案server的埠配置正確和配置檔案下的profile配置路徑正確。這是本人在做專案時候發現的錯誤,最後是以上述兩種操作解決這個問題的,有待觀察