乐趣区

关于ubuntu:tomcatThe-selected-directory-in-not-a-valid-Tomcat-home

环境

  • Linux/Ubuntu20.04LTS
  • Visual Studio Code
  • Tomcat9.0.48

异样

抉择的目录不是 Tomcat 的目录

The selected directory in not a valid Tomcat home

起因

tomcat 的目录权限有余!

计划

  1. 目录权限有余就目录的应用权限,进入到 Tomcat 的装置目录,这里的装置目录是 /usr/local,775 为 rwxr-xr-x,-R 即目录下所有文件权限都一样
lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local$ sudo chmod 755 -R apache-tomcat-9.0.48
[sudo] lauiji 的明码:
  1. 查看权限
lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local$ ll
总用量 56
...
drwxr-xr-x  9 root root 4096 6 月  29 18:04 apache-tomcat-9.0.48/
  1. 进入到 Tomcat 的目录下执行运作,看是否能运行胜利, 胜利运行则阐明当初的权限够了
lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local/apache-tomcat-9.0.48/bin$ ./startup.sh
Using CATALINA_BASE:   /usr/local/apache-tomcat-9.0.48
Using CATALINA_HOME:   /usr/local/apache-tomcat-9.0.48
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.48/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/apache-tomcat-9.0.48/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.48/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
Tomcat started.

如果没有批改端口号的话,即可通过浏览器拜访 localhost:8080

  1. 敞开服务
lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local/apache-tomcat-9.0.48/bin$ ./shutdown.sh
Using CATALINA_BASE:   /usr/local/apache-tomcat-9.0.48
Using CATALINA_HOME:   /usr/local/apache-tomcat-9.0.48
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.48/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/apache-tomcat-9.0.48/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.48/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
  1. 在 vscode 下从新抉择 Tomcat 的目录即可,/usr/local/apache-tomcat-9.0.48

【遇上旱季,吃定彩虹】— Layuji

退出移动版