The environment
- Linux/Ubuntu20.04 LTS
- Visual Studio Code
- Tomcat9.0.48
abnormal
The directory selected is not the directory of Tomcat. When installing Tomcat plug-in under vscode, it is prompted to select the directory of Tomcat service, and there is no response when selecting the directory again.
The selected directory in not a valid Tomcat home
why
Insufficient directory permissions on Tomcat!
plan
- /usr/local/775 is rwxr-xr-x. -r means all files in the directory have the same permissions
lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local$sudo chmod 755-r apache-tomcat-9.0.48 [sudo] lauiji
- Check the permissions
lauiji@lauiji-IdeaPad-15sIML-2020:/usr/local$ll Drwxr-xr-x 9 root root 4096 June 29 18:04 apache-tomcat-9.0.48/
- Enter the Tomcat directory to execute the operation, to see if it can run successfully, successful operation means that the current permissions are enough
Lauiji @ lauiji - siml IdeaPad - 15-2020: / usr/local/apache tomcat - 9.0.48 $. / bin/startup. Sh Using CATALINA_BASE: /usr/local/apache-tomcat-9.0.48 Using CATALINA_TMPDIR: /usr/local/apache-tomcat /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.
If you haven’t changed the port number, you can access localhost:8080 through your browser
- Close the service
Lauiji @ lauiji - siml IdeaPad - 15-2020: / usr/local/apache tomcat - 9.0.48 $. / bin/shutdown. Sh Using CATALINA_BASE: /usr/local/apache-tomcat-9.0.48 Using CATALINA_TMPDIR: /usr/local/apache-tomcat /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
- Reselect Tomcat to /usr/local/apache-tomcat-9.0.48 under vscode
In the rainy season, eat the rainbow