Eclipse創建jsp後報錯Multiple annotations found at this line:- The superclass “javax.servlet.http.HttpServlet” was not found on the JavaBuild Path- The superclass “javax.servlet.http.HttpServlet” was not found on the JavaBuild Path
這裏寫圖片描述
是因爲缺少servlet-api.jar右擊項目文件,選擇Build Path–>Configure Build Path…–>Libraries如果沒有Apache Tomcat,就點擊Add Library–>Server Runtime–>Next–>選擇Apache–>Finish,刷新項目看看錯誤是否消失。
如果有Apache Tomcat就點擊Add Library…–>Server Runtime–>Next–>點擊Apache tomcat->Finish–>ok,