原因:

使用Eclipse进行Maven项目开发时,可能会出现这样的错误:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path
如下图错误显示:
java错误:The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path

解决办法:

  1. 在出现此错误的项目上单击鼠标右键->Build Path->Configure Build Path
    java错误:The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path

  2. 选择Server Runtimejava错误:The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path

  3. 选择所需的Tomcat版本
    java错误:The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path
    点击完成之后,错误就会消失了。

相关文章:

  • 2021-08-18
  • 2021-10-04
  • 2021-04-17
猜你喜欢
  • 2021-10-24
  • 2021-05-31
  • 2021-06-01
  • 2021-07-27
  • 2021-06-22
  • 2021-07-07
相关资源
相似解决方案