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

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

java錯誤:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

我們在用Eclipse進行Java web開發時,可能會出現這樣的錯誤:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path。我們該怎麼解決這個問題呢?

我們遇到的錯誤顯示如下:
在這裡插入圖片描述

我們右擊有錯誤提示的project,點選”配置構建路徑“,如下:
在這裡插入圖片描述

我們再點選”新增庫“,如下:
在這裡插入圖片描述

我們選中上圖中標出的選項,再點選下一步,如下:
在這裡插入圖片描述

我們再點選”完成“,如下:
在這裡插入圖片描述

即可完成設定。這樣我的錯誤就會消失了。

轉自:https://www.cnblogs.com/achengmu/p/8082457.html