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 解决方法的更多相关文章

  1. 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 Pat ...

  2. 项目出现 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 ①项 ...

  3. 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 ...

  4. 新建maven指定jdk版本-eclipse新建maven项目报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path的解决方案

    具体表现为: 使用Eclipse+Maven建立了一个Javaweb工程,JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.Http ...

  5. 使用maven创建项目时报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

    Description Resource Path Location Type The superclass "javax.servlet.http.HttpServlet" wa ...

  6. The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决办法

    ♦  未在 Java构建路径中 找到父类 "javax.servlet.http.HttpServlet" ♦ 解决办法: 项目右击 → Build Path → 右侧 Add L ...

  7. web项目jsp出现The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path错误

    原因是Javaweb工程类中没有添加Tomcat运行时相关类导致. 解决方式如下:出错的文件---->>build path---->>config build path--- ...

  8. 新建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 ...

  9. 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& ...

随机推荐

  1. play for scala 实现SessionFilter 过滤未登录用户跳转到登录页面

    一.编写SessionFilter.scala代码 package filters import javax.inject.{Inject, Singleton} import akka.stream ...

  2. Spark中容易遇到的问题

    1. 序列化错误 所有需要传给RDD的变量都要实现java.io.Serializable接口.

  3. markdown语法测试

    斜体 粗体 百度 标题一 -------- 标题二 ======== 标题三 标题四 有序列表一 有序列表二 无序列表一 无序列表二 这是引用的文字 这是一句行内代码var=1 public clas ...

  4. *BigDecimal初识

    Java在java.math包中提供的API类BigDecimal,用来对超过16位有效位的数进行精确的运算.双精度浮点型变量double可以处 理16位有效数.在实际应用中,需要对更大或者更小的数进 ...

  5. java中nextLine()和next()的区别

    >概述 在实现字符窗口的输入时,我个人更喜欢选择使用扫描器Scanner,它操作起来比较简单.我发现用Scanner实现字符串的输入有两种方法,一种是next(),一种nextLine(),但是 ...

  6. First insmod a module

    不得不说网上坑爹的文章比虱子还多,参考这位仁兄调试成功 喜欢C的人却靠着Java产业吃饭,人艰不拆... 对于未知的东西,有个习惯,run success first,then research en ...

  7. python实现并行爬虫

    问题背景:指定爬虫depth.线程数, python实现并行爬虫   思路:    单线程 实现爬虫类Fetcher                 多线程 threading.Thread去调Fet ...

  8. Leetcode: Split Array Largest Sum

    Given an array which consists of non-negative integers and an integer m, you can split the array int ...

  9. ZoomBar 设计

    package com.example.canvasdemo; import android.content.Context; import android.graphics.Canvas; impo ...

  10. 使用AppCan实现分享网站功能

    使用AppCan实现分享网站功能 昨天我们实现了最基本的文字分享功能,今天呢,我们来实现基本的分享网站功能: 微信指引部分这里不再复述,具体请参见:http://newdocx.appcan.cn/i ...