HttpServlet was not found on the Java

我们在用Eclipse进行Java web开发时,可能会出现这样的错误:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path。  如下:

HttpServlet was not found on the Java

1、右击项目——>Build Path——>configure Build Path 出现下图

HttpServlet was not found on the Java

2、点击 “Add Library” 

HttpServlet was not found on the Java

3、单击 “server Runtime"

HttpServlet was not found on the Java

4、选中要添加的库

HttpServlet was not found on the Java

5、最后单击“finish”,这样就设置成功了。