Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the superclass "javax.servlet.httpServlet" was not found on the Java Build Path

I have get a problem when I create a new web project in the eclipse.
There show 'the superclass "javax.servlet.httpServlet" was not found on the Java Build Path'.
I have find solution on the Internet, but that not work.
The solution is Project Properties-> Java Build Path-> Add Library -> Select "Server Runtime" from the list-> Next->Select "Apache Tomcat"-> Finish.
Is there anybody can give me other solution? Thanks very much.
My OS is macOS,tomcat is 9.0.0.M9,jdk is 1.8.0_101,the eclipse is jee-neon.

like image 776
Tour4x Avatar asked Aug 17 '16 08:08

Tour4x


1 Answers

I have solved the problem by doing the following,

Actually i got this error, my scenario was..

I was using the APACHE TOMCAT SERVER VERSION 8.0, but the project i downloaded was using APACHE TOMCAT VERSION 7.0 it seems, so i changed it to version 8.

How was did was:

  1. right Click on the Project properties.
  2. In the Left menu, we can see the Java Build Path
  3. Select the Library tab, and add the new Library.
  4. In the Library Type, select the Server Run time, then click next and Finish will solve the problem.

All the Best

like image 51
javailike Avatar answered Sep 28 '22 23:09

javailike