首先如果直接使用 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

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

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

相关文章:

  • 2022-12-23
  • 2021-05-31
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
猜你喜欢
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-12-17
  • 2021-09-01
  • 2021-12-02
  • 2022-12-23
相关资源
相似解决方案