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 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會記住重灌系統前的路徑?

轉載:http://www.cnblogs.com/issa/p/3613909.html

相關推薦

專案忽然出現 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

專案出現 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 ①專案右擊–>build path -->新增libraries–>s

maven專案 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

在myeclipse中,新建maven專案報如題錯誤。對於這個問題,各種搜尋,沒有找到完全一樣的教程,最後終於自己搞好啦。搜尋得知,因為沒有找到tomcat 伺服器,解決辦法:專案名——右擊——Add Library——Myeclipse Server Library——(接

[IDE - Eclipse] JSP報錯:The superclassjavax.servlet.http.HttpServletwas not found on the Java Build Path

引入 ips eclips size eclipse -i let details javax 是因為Eclipse的Web項目不自動引入相關jar包. Right Click on the Project ? Properties ? Project Facets. Yo

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

①.     1.右鍵點選專案->build path->configure build path->add library->server runtime->apache tomcat 無果,無法新增。 ②.   1.開啟Eclipse

JSP頁面提示 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

解決步驟: 1:開啟專案屬性頁面 2:點選Java BuildPath 3:點開 Libraries選項卡 4:點選Add Library 5:選中 Server Runtime 6:選擇

JSP報錯:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

今天使用Eclipse+Maven建立了一個Javaweb工程,並在eclipse中配置了Web容器Jboss eap 6.2。新建jsp頁面,新增一個簡單 的Java類。可是,JSP頁面頂端出現“紅色”的報錯資訊:The superclass "javax.servlet.http.HttpServlet

【HTML5入門】解決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

Description Resource Path Location Type The superclass "javax.servlet.http.HttpServlet" was not foun

建了一個簡單web專案,但是專案出了一個Description Resource Path Location Type Description Resource Path Location Type The superclass "javax.servlet.http.Ht

錯誤:The superclass "javax.servlet.xxx" was not found on the Java Build Path

當一個Java Web專案從一臺電腦移到另一臺電腦時,個人感覺環境都一致,但是就是在使用的時候出現一些小紅叉,特別是在一些jsp頁面出現最多: 如:The superclass "javax.servlet.http.HttpServlet" was not found on the Jav

jsp頁面出現Multiple annotations found at this line: - The superclass "javax.servlet.http.HttpServlet" w

新建jsp頁面老提示: Multiple annotations found at this line:   - The superclass "javax.servlet.http.HttpServlet" was not found on the Java   B

eclipse更改workspace中出現The superclass "javax.servlet.http.HttpServlet" was not found on the Java----問題》》

win runtime cli 名稱 tail 一個 fig workspace found 第一步:那是因為在項目中沒有告訴它應該在哪個tomcat中運行,右擊項目名稱-----》build path--》configure path---->library--

使用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" was not found on the Java Build Path index.jsp /ssm-crud/Web

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path Maven專案報錯:Failed to execute goal org.apache.maven.plugi

 ① The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 完整錯誤資訊: THIS SOFTWARE IS PROVIDED BY THE

[轉]The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

right clas rup b- row 添加按鈕 n) 1-1 自帶 完整錯誤信息: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"AS IS" AND ANY EXPRESS O

新建 jsp異常,The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

prop 選擇 library path per png class pro found   新項目,新建jsp頁面的時候報異常: Multiple annotations found at this line: - The superclass "java

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

uil 路徑 next run library per 錯誤 https 取消 新建WEB項目出現如下錯誤,可以這樣來修正, The superclass "javax.servlet.http.HttpServlet" was not found on the Java

eclipse - The superclass "javax.servlet.http.HttpServlet" was not found on the Java

https 技術分享 eclips vax logs let not super images eclipse - The superclass "javax.servlet.http.HttpServlet" was not found on th

JavaWeb:報錯信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

服務器軟件 vax ini AC 信息 enc 點擊 let 選擇服務器 JavaWeb: 報錯信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 一般

MyEclipse中,使用Maven新建web項目後,提示The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

web png -a ips cti code 使用 te pro ron 問題描述:   使用 MyEclipse + Maven 建立了一個 Javaweb工程,在編寫 JSP頁面 時,頂端出現“紅色”的報錯信息:The superclass