[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

时间:2023-03-09 20:36:39
[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

一段时间没用eclipse后,再去打开以前的项目,发现一打开前线标红。查看错误的时候,如下图所示:

[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

原来是“在Java构建路径上没有找到超'javax servlet .http.httpservlet'”

所以直接在原来报错的项目右键>>Build Path>>Configure Build Path,进行项目的配置生成路径。如图:

[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

Add Library---->>Server Runtime (配置要运行的服务器)

[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

酱紫,就完成了项目部署了你要运行的服务器!但还没有解决问题!

[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

你还得需要部署JRE(Java Runtime Environment)运行环境和一些相关的lib.。。。最后Apply and Close就行了。如图:

[Eclipse]--Error:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.

这样就解决了那些红彤彤的Error!