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 来关闭,否则会报上面的错误

猜你喜欢

转载自www.cnblogs.com/train99999/p/12231616.html