天天看點

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配置路徑正确。這是本人在做項目時候發現的錯誤,最後是以上述兩種操作解決這個問題的,有待觀察