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

首先若是直接使用 root 用户来启动 tomcat 的话,是能够正常启动的。java

可是咱们在 Linux 中使用普通用户启动 tomcat 报了以下错误apache

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。tomcat

解决办法:this

打开 setclasspath.shspa

sudo vi setclasspath.sh

而后设置 JAVA_HOME 和 JRE_HOMEcode

image

而后再使用命令 sudo ./startup.sh 从新启动 tomcat
关闭的话也要使用 sudo ./shutdown.sh 来关闭,不然会报上面的错误blog

相关文章
相关标签/搜索