Record an IDEA error: java: package javax.servlet.http does not exist

Pull a new project from gitlab, when building the project, prompt:

java: package javax.servlet.http does not exist

 After investigation, I found that the package does not exist locally, and there is no such reference in the POM file (I don’t understand why others don’t report errors), so I downloaded the jar package and imported it into the SDK. The operation steps are as follows:

First put the mouse on the dependency that reported the error:

 Or click the red prompt box, the following options will appear:

Then click Download Dependency, and then follow the steps below:

Enter the project structure first

 

 Then select SDKs, click +

choose to depend

 Adding is complete, click Apply

 At this point, the import of dependencies is completed.

Guess you like

Origin blog.csdn.net/cccsssrrr/article/details/132149054