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.
 
    
    - 63
- 1
- 1
- 5
- 
                    2Maybe typo? "javax.servlet.httpServlet" or "javax.servlet.HttpServlet" – jlumietu Aug 17 '16 at 11:00
- 
                    Hi, I'm so sorry I can't understand you meaning, I just start learn the JSP. I have change the tomcat 8, and there is no problem with the project, I don't know why.Thanks anyway for your help. – Tour4x Aug 17 '16 at 12:56
- 
                    1If you typed httpServlet with lowercase 'h', try correcting it with uppercase 'H', just like "HttpServlet" – jlumietu Aug 17 '16 at 12:57
- 
                    Specifically, if you have a page directive in your JSP referencing that type as its superclass. Java is a case sensitive language. – nitind Aug 17 '16 at 14:49
4 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:
- right Click on the Project properties.
- In the Left menu, we can see the Java Build Path
- Select the Library tab, and add the new Library.
- In the Library Type, select the Server Run time, then click next and Finish will solve the problem.
All the Best
 
    
    - 247
- 1
- 4
- 13
I tried above steps and still errors were there in JSP even runtime libraries were configured properly. I'm using java 8 and tomcat 8. So I unchecked "validate jsp fragments" under project properties > validation > jsp syntax.
 
    
    - 525
- 5
- 5
With using Eclipse:
Version: Oxygen.2 Release (4.7.2)
Build id: 20171218-0600
I solved the Tomcat Server Library import as follows:
- Right Click on the Project properties.
- In the Left menu, we can see the Java Build Path.
- Select the Librariestab, andAdd Librarybutton.
- In the Add Librarywindow, select theServer Runtimein the list.
- Click on Nextbutton, Select the itemApache Tomcatmentioned with version in the list, and click onFinishbutton.
Wish it makes smile on your face!
 
    
    - 1,245
- 11
- 20
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.
If you work tomcat10 this solution maybe didn't worked for you. My solution is going to instead tomcat10 to tomcat9.And I solve it. https://www.youtube.com/watch?v=jM-eWX102LQ this video can help you.
 
    
    - 1
- 1