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,如下图

配置Build Path

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

![Libraries]

  • 选择Server Runtime

Server Runtime

  • 选择tomcat服务器

选择tomcat服务器

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

没有错误提示

原文地址:https://www.cnblogs.com/lantor/p/7351203.html