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

时间:2023-06-21 11:04:31

我们在利用Eclipse进行Java web开发时,可能会出现这样的错误: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

处理办法如下:

1、打开“配置编译路径”,如下图

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

2、点击“Add Library”

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

3、选择“Server Runtime"

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

4、选择”Apache Tomcat v8.0"(根据实际选择)

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

5、完成,关闭相关窗口。

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