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

一、遇见的错误

  • 今天在搭建maven时,创建的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)再点击 添加库
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法
  • (3)选中上图中标出的选项,再点击下一步
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法
  • (4)再点击 完成,注意:最后点击 Apply and Close关闭窗口。
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法