项目忽然出现 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法
来源:互联网 发布:linux login incorrect 编辑:程序博客网 时间:2024/05/16 04:41
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会记住重装系统前的路径?
转载:http://www.cnblogs.com/issa/p/3613909.html
- 项目忽然出现 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的解决方法
- 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的解决方法
- 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 Build Path
- 导入项目出现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
- 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
- 【Bug笔记】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
- 三角剖分 与Delaunary三角剖分
- CreateThread和_beginthread区别及使用http://blog.csdn.net/wxq1987525/article/details/6620210
- android(19)(两种方式从网络抓取图片显示在本地)
- RecyclerView介绍(三)----实现GridView效果
- 用myeclipse来创建第一个web程序
- 项目忽然出现 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法
- windows下,在python中安装xgboost的简易方法,解决 error C3861: “sleep”: 找不到标识符”
- JavaScript学习笔记1
- python--字典排序
- 走向心灵的轻音乐
- Code Forces 592 B. The Monster and the Squirrel(水~)
- 黑马程序员-Java中基本类型对应的类(装箱与拆箱)
- 爬爬爬之路:UI(十五) KVO
- bzoj2823[AHOI2012]信号塔