The environment

  • Linux/Ubuntu20.04 LTS
  • IntelliJ IDEA Community Editon 2021.1
  • Tomcat 7.0.109
  • javax.servlet

abnormal

An exception occurred at compile time that could not find javax.servlet.Filter

/ home/lauiji/Desktop/SSH/SRC/com/SSH/EncodingFilter. Java: supplications of Java: package javax.mail. Servlet does not exist

why

In this case, the project is generally missing the corresponding JAR package, here is missing servlet, that is, the package under the running service, add the running service JAR package, that is, the running environment.

The Tomcat 7.0.109 runtime environment was added here.

plan

  1. If you want to install Tomcat, you will need to select “File->” Project strutcutrue-> modules-> Dependencies. If you want to install Tomcat, you will need to select the “lib” directory

  1. Select New Library, then the lib folder in the directory where Tomcat was installed. The path here is /usr/local/apache-tomcat-7.0.109/lib

  1. After creating successfully, select Add Selected and reference it to the project

In the rainy season, eat the rainbow