tomcat:The|tomcat:The selected directory in not a valid Tomcat home
环境
- Linux/Ubuntu20.04LTS
- Visual Studio Code
- Tomcat9.0.48
选择的目录不是Tomcat的目录,vscode下安装tomcat插件,选择tomcat服务目录时,提示选择的不是Tomcat目录,并再次选择时没有任何反应。
The selected directory in not a valid Tomcat home
原因
tomcat的目录权限不足!
方案
- 目录权限不足就目录的使用权限,进入到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 的密码:
- 查看权限
lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local$ ll
总用量 56
...
drwxr-xr-x9 root root 4096 6月29 18:04 apache-tomcat-9.0.48/
- 进入到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
- 关闭服务
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
- 在vscode 下重新选择Tomcat的目录即可,/usr/local/apache-tomcat-9.0.48
推荐阅读
- Linux下面如何查看tomcat已经使用多少线程
- 探索免费开源服务器tomcat的魅力
- 【Thesewt】蒙昧(续)
- Tomcat8带来的坑
- The|The Help week 3
- The|The ideal servant
- maven使用tomcat7插件编译jsp出错
- 分析COMP122 The Caesar Cipher
- Nginx|Nginx Tomcat 构造https服务应对苹果要求
- 清晨朗读327(How|清晨朗读327:How Successful People Network with Each Other)