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 解决方法
0.环境:
新装win8.1系统,Tomcat配置无误。
1.错误:
项目中某一.jps页面忽然出现错误,鼠标点上去为:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path.
忽视错误,在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: D:/Program Files/apache-tomcat-7.0.52/bin/bootstrap.jar which is referenced by the classpath, does not exist.
2.查找原因:
原本我的Tomcat路径为:D:\Program Files\apache-tomcat-7.0.52\,后来由于重装系统,改为:D:\ProgramFiles\apache-tomcat-7.0.52\,在报错中可以发现是缺少servlet-api.jar,也即tomcat路径问题。
3.尝试解决:
①.
1.右键点击项目->build path->configure build path->add library->server runtime->apache tomcat
无果,无法添加。
②.
1.打开Eclipse中tomcat配置,就是双击server选项卡中的tomcat,然后选择openlaunch configuration,如下图所示:
2.打开以后会出现如下界面:

3.如上图所示,将错误路径删除,并保证正确配置tomcat-juli.jar和bootstrap.jar这两个jar包的路径。
无果,修改后仍启动不了Tomcat。
③.
1.在server选项卡中删除所有server,新建tomcat。
无果,无法新建。
④.
1.退出 eclipse
2.到[工程目录下]/.metadata/.plugins/org.eclipse.core.runtime
3.把org.eclipse.wst.server.core.prefs和 org.eclipse.jst.server.tomcat.core.prefs这两个文件去掉
4.重启eclipse
无果,没找到org.eclipse.wst.server.core.prefs和 org.eclipse.jst.server.tomcat.core.prefs这两个文件。
⑤.
1.在Eclipse中,Window-->preference --> servers --> runtime --> environments --> 全部删除
2.Add-->Browse-->选择本地tomcat文件夹所在位置-->确定 --> finish-->OK
成功!
4.结论:
实际上是preference中路径错误的问题,直接删除掉server再重建的方法不行。
以后在移动相关资源或者依赖资源的时候会对原有的依赖它的项目产生影响。尽量将自己的IDE和相关的环境固定,少做更改,减少那些隐藏的错误出现的几率。
5.后续疑问:(未解)
重装系统后Tomcat、Eclipse都是重新解压配置的,为何Eclipse会记住重装系统前的路径?
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 解决方法
0.环境: 新装win8.1系统,Tomcat配置无误. 1.错误: 项目中某一.jps页面忽然出现错误,鼠标点上去为:The superclass "javax.servlet.http. ...
- 项目出现 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 ①项 ...
- java eclipse maven The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法
在eclipse 中使用maven 创建java web项目,启动服务器遇到提示:The superclass "javax.servlet.http.HttpServlet" w ...
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决办法
♦ 未在 Java构建路径中 找到父类 "javax.servlet.http.HttpServlet" ♦ 解决办法: 项目右击 → Build Path → 右侧 Add L ...
- 新建jsp文件,The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误解决方法
新建一个jsp文件后,有一个错误,The superclass "javax.servlet.http.HttpServlet" was not found on the Java ...
- HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
HttpServletRequest cannot be resolved to a type The superclass "javax.servlet.http.HttpServlet& ...
- jsp页面提示“Multiple annotations found at this line: - The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path”解决方案
Multiple annotations found at this line: - The superclass "javax.servlet.http.HttpServlet" ...
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path解决方案
0.环境: win7系统,Tomcat9配置无误. 1.错误: 项目中某一.jps页面忽然出现错误,鼠标点上去为:The superclass "javax.servlet.http.Htt ...
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path。问题
JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Ja ...
随机推荐
- 什么是 Delta 文件
什么是 Delta 文件 Delta 文件应用很广泛,特别是在数据库领域 What Is a Delta File? During most computer operations, copying, ...
- HTTP API响应数据规范整理
概述 本文档为本人对长期开发API接口所整理的经验总结,如有不完善或不合理的地方,望各位多提意见. 文档目的为规范服务器端API接口,便于服务器端与客户端代码重用.服务器端和客户端可根据实际所定义规范 ...
- string、const char*、 char* 、char[]相互转换(待整理)
string.const char*. char* .char[]相互转换(全) https://blog.csdn.net/rongrongyaofeiqi/article/details/5244 ...
- visio 的使用方法
1:往visio中添加商务图形和形状的方法.例如饼状图. 文件>形状>商务>图表和图形>绘制图表形状 2:visio 画半弧形,用铅笔 3: visio 画的图形,如果想要和v ...
- 使用tagName定位报错
使用标签进行定位元素,页面报错,由于input标签不唯一,webdriver默认会取第一个元素,但是第一个input元素的类型是‘hidden’,无法展示,因此程序就报错了 如何解决,未完待续...
- Catch all the latest Jordan Release Dates
In case y'all missed yesterday's news, Air Jordan 13 Olive 2018 officially unveiled their 2017 Holid ...
- git克隆代码
1.vs--team explorer-clone,或者team-connect to tfs-clone 2.1输入git的url,2输入本地放代码的文件夹,3点clone,克隆出4.双击4 3.点 ...
- Lower Power with CPF(三)
常用的一些Lower Power的策略: 1)Clock tree optimization and clock gating:在正常情况下clock信号会一直toggle at the maximu ...
- vue的双向数据绑定原理
原理. vue是采用数据劫持结合发布者-订阅者模式的方式, 通过Object.defineProperty()来劫持各个属性的setter,getter,在数据变动时发布消息给订阅者,触发相应的监听回 ...
- Linux虚拟机克隆后网卡UUID问题
虚拟机中的Linux系统克隆后,网卡配置eth0中的UUID可被克隆的系统是一样的,这样UUID就失去了唯一性. 我参考了该篇博客: 有时我们不小心将/etc/sysconfig/network-sc ...