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 ...
随机推荐
- Java学习之路-RMI学习
Java远程方法调用,即Java RMI(Java Remote Method Invocation)是Java编程语言里,一种用于实现远程过程调用的应用程序编程接口.它使客户机上运行的程序可以调用远 ...
- python 面向对象 issubclass
判断是否 他的父类 class Foo(object): pass obj = Foo() class Boo(Foo): pass class Coo(Boo): pass obj = Boo() ...
- Tensorflow(二)
1---------------- 试用tensorflow的模块,必须配套tensorflow的方法 import tensorflow as tf a=3 ##定义 行向量 w=tf.Variab ...
- java-基础-【一】枚举
enum 的全称为 enumeration, 是 JDK 1.5 中引入的新特性,存放在 java.lang 包中. 一.static final定义[jdk1.5之前] public static ...
- 7.MQTT网页客户端连接MQTT服务器的问题WebSocket connection to 'ws://XXX:1883/' failed: Connection closed before receiving a handshake response
问题描述:MQTT.js提供了连接MQTT的一套javascipt的方法,可供前端连接到MQTT服务器,也可以作为脚本测试.以脚本形式,用nodejs运行,是没有问题的,能够正常连接并且发送报文.但是 ...
- [py]python内存管理
Python深入06 Python的内存管理 堆栈内存 - 堆内存 对象一般就是开辟在堆上的结构体: 堆内存用于提供 引用数据类型存储值 对象存储的是属性名和属性值 函数存储的是函数体代码字符串 函数 ...
- [LintCode] 394. Coins in a Line_ Medium tag:Dynamic Programming_博弈
Description There are n coins in a line. Two players take turns to take one or two coins from right ...
- 找回丢失的mysql服务的root用户的密码
一.关闭mysqld服务.服务名称则根据电脑上的实际服务名来决定,windows下则用以管理员身份运行cmd.exe程序,然后输入:net stop mysql的服务名称. 二.打开一个cmd窗口,以 ...
- AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 6. Mathematical Concepts and Methods
uva 106 这题说的是 说计算 x^2 + y^2 = z^2 xyz 互质 然后计算个数和 在 N内 不在 勾股数之内的数的个数 然后去找需要的 维基百科上 看到 另 n*m*2 =b ...
- Zookeeper使用实例——分布式共享锁
前一讲中我们知道,Zookeeper通过维护一个分布式目录数据结构,实现分布式协调服务.本文主要介绍利用Zookeeper有序目录的创建和删除,实现分布式共享锁. 举个例子,性能管理系统中,告警规则只 ...