The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

刚配置好JSP环境写第一个页面的时候,eclipse可能会提示这个上面的错误The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path,对于新手来说可能不知道怎么解决,下面说一下解决办法。

  • 首先在你的项目文件夹上右键,选择Build Path->Configure Build Path,如下图

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

  • 然后选择Libraries->Add Library...

[Libraries]The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

  • 选择Server Runtime

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

  • 选择tomcat服务器

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

  • 确定后点击Apply and Close保存即可,这时就没有了错误提示。

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path