天天看点

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错误解决办法

当代码头<%@报这个“The superclass “javax.servlet.http.HttpServlet” was not

found on the Java Build Path”错误时,可能是项目没有添加tomcat库导致的,解决办法如下:

  1. 找到报错的项目,右击选择Build Path >> Configure Build Path…
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误解决办法
  2. 依次选择Java Build Path >> Libraries >> Add Library
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误解决办法
  3. 选择Server Runtime,然后Next
    The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误解决办法
  4. 选择你创建该项目时所使用的tomcat版本,这里我是7.0,所以选第一个,然后Finish
    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错误解决办法

做完以上步骤后,错误就消失了,项目就能正常运行了

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

继续阅读