1. 程式人生 > >JavaWeb:報錯信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

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

一般是由於沒有添加服務器運行時(server runtime)所致,那麽為項目配置服務器運行時:依次右鍵點擊項目名稱,選擇Build Path->Configure Build Path->彈出Java Build Path對話框,默認選中的是Libraries選項卡->右側點擊Add Library....->彈出Add Library對話框,選擇Server Runtime ->Next ->選擇服務器,Finish -> 回到Java Build Path,點擊OK即可。那麽,錯誤將消失。

註意: 按以上方法操作時,若打開Server Runtime後一片空白,需要設置Apache服務器。設置方法為:window->Preferences->Server->Runtime Environment -> add --> 選擇Apache的版本後點Next,再填入你apache服務器軟件的安裝(解壓後)地址。

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