解决Eclipse报错:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path

解决Eclipse报错:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

文章目录

  • 解决Eclipse报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
      • 方法一
      • 方法二

  • 问题原因:原来Javaweb工程类中没有添加 Tomcat运行时相关类导致。

方法一

我们右击有错误提示的文件夹,点击”配置构建路径“,如下图:
解决Eclipse报错:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path_第1张图片
点击”添加库“,如下图:
解决Eclipse报错:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path_第2张图片
选中上图中标出的选项,再点击下一步,如下图:
解决Eclipse报错:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path_第3张图片
点击”完成“,如下图:
解决Eclipse报错:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path_第4张图片
如果问题还没解决,参考方法二

方法二

添加jar包,如图:
解决Eclipse报错:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path_第5张图片
OK,问题就解决了!

你可能感兴趣的:(学习ing)