Superclass "javax.servlet.httpServlet" not found on Java build path

I am having a problem when I create a new web project in eclipse.
"Superclass" is displayed there. Javax.servlet.httpServlet "not found in Java build path".
I found a solution on the Internet, but this does not work.
Solution - Project Properties → Java Build Path → Add Library → Select "Server Runtime" in the list-> Next-> Select "Apache Tomcat" → Done.
Can anyone give me another solution? Many thanks.
My OS is macOS, tomcat is 9.0.0.M9, jdk is 1.8.0_101, eclipse is jee-neon.

+4
source share
3 answers

I solved the problem by doing the following:

Actually, I got this error, my script was ...

I used APACHE TOMCAT SERVER VERSION 8.0, but the project I downloaded used APACHE TOMCAT VERSION 7.0, so I changed it to version 8.

How it was:

  • right Click on project properties.
  • In the left menu we can see the Java build path
  • Select the Library tab and add a new library.
  • In the "Library Type", select the server startup time, then click "Next", and "Finish" will solve the problem.

All the best

+10
source

JSP, . java 8 tomcat 8. " jsp" a > > jsp.

0

Eclipse:

Version: Oxygen.2 Release (4.7.2)
Build id: 20171218-0600

Tomcat Server Library :

  • Project properties.
  • Java Build Path.
  • Libraries Add Library.
  • Add Library Server Runtime .
  • Next, Apache Tomcat, , Finish.

, !

0

Source: https://habr.com/ru/post/1651506/


All Articles