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

uil 路徑 next run library per 錯誤 https 取消

新建WEB項目出現如下錯誤,可以這樣來修正,

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

進入Window-preference,選擇Server-Runtime Environment,

選擇Add,在彈出頁面上,選擇本機已經安裝好的Tomcat版本,next,並指定路徑。

window-show view-server,選擇添加server,把剛才添加的tomcat加入到此server中,這個時候項目中會多出來一個servers項目

項目屬性,build path,library,add library,選擇 server runtime,確定,錯誤取消。

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