The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path类似问题简单解决方案
分类:
文章
•
2024-03-08 21:11:16
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类似问题简单解决方案 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path类似问题简单解决方案](/default/index/img?u=aHR0cHM6Ly9waWFuc2hlbi5jb20vaW1hZ2VzLzMyOC8xNjlhYjU2MTMxZTAzZWUwMDJiMDAxMjQyYWU0YjNkOC5wbmc=)
一、选择出现该问题的文件工程,然后右击文件工程,再点击选择红色箭头2指向的红色框中的内容(Bulid Path),然后再点击红色箭头3指向的红色框中的内容(Configure Bulid 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类似问题简单解决方案](/default/index/img?u=aHR0cHM6Ly9waWFuc2hlbi5jb20vaW1hZ2VzLzk2NC81ODE2OGEyNTUzNTg0MGNjZWViMzQzYzdlZDYyN2U3NC5wbmc=)
二、出现新页面之后,选择点击(Libraries),然后再点击红色箭头2指向的红色框中的内容(Classpath),然后再选择点击红色箭头3指向的红色框中的(Add Library…)。
![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类似问题简单解决方案](/default/index/img?u=aHR0cHM6Ly9waWFuc2hlbi5jb20vaW1hZ2VzLzI5OS9jYTI0MDk5ZGY0NzZkZWE0Yjg3MWEzMzQyMzUwNjk0Yi5wbmc=)
三、出现新页面之后,选择红色箭头1指向的红色框中的内容(Server Runtime),然后再选择点击红色箭头2指向的红色框中的内容(Next)。
![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类似问题简单解决方案](/default/index/img?u=aHR0cHM6Ly9waWFuc2hlbi5jb20vaW1hZ2VzLzc4My9lZjhmZjY3YzU0NjE4ZDM0ODliNGE2ZWQ3Mjg0NTZhZi5wbmc=)
四、选择红色箭头1指向的红色框中的内容(Apache Tomcat v7.0,注意:博主在自己电脑下载的Eclipse中安装的Tomcat是这个,若大家没有安装Tomcat的可以参考博主的文章,点击打开文章链接:Eclipse 服务器配置之安装 Tomcat 服务器,有的自己选择自己安装版本的Tomcat就行),然后点击红色箭头2指向的红色框中的内容(Finsh)。
![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类似问题简单解决方案](/default/index/img?u=aHR0cHM6Ly9waWFuc2hlbi5jb20vaW1hZ2VzLzg2NC9lZmZmNmNmMDM4NzczYWUxNGUwMDljMzgzMzIzMjZhMC5wbmc=)
五、然后再选择点击红色箭头指向的红色框中的内容(Apply and Close)。
![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类似问题简单解决方案](/default/index/img?u=aHR0cHM6Ly9waWFuc2hlbi5jb20vaW1hZ2VzLzQyL2U1MjNkYzMxYWRhNTA2OTI5NTlmNTQxOTEzNTI1ZmUyLnBuZw==)
六、然后再看之前的代码,没有报错就解决问题了。
![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类似问题简单解决方案](/default/index/img?u=aHR0cHM6Ly9waWFuc2hlbi5jb20vaW1hZ2VzLzU4Ni9iN2ZiMWNkN2Y2MTZhMTI1YmQyNTRjZmRiN2Y1ZDZlMi5wbmc=)