Cannot find tomcat目錄/bin/setclasspath.sh This file is needed to run this program


首先如果直接使用 root 用戶來啟動 tomcat 的話,是可以正常啟動的。

但是我們在 Linux 中使用普通用戶啟動 tomcat 報了如下錯誤

Cannot find /developer/apache-tomcat-8.5.50/bin/setclasspath.sh
This file is needed to run this program

原因是沒有在 setclasspath.sh 上設置 JAVA_HOME 和 JRE_HOME。

解決辦法:

打開 setclasspath.sh

sudo vi setclasspath.sh

然后設置 JAVA_HOME 和 JRE_HOME

image

然后再使用命令 sudo ./startup.sh 重新啟動 tomcat
關閉的話也要使用 sudo ./shutdown.sh 來關閉,否則會報上面的錯誤


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM