当我们使用Eclipse时,有时会出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path这样的错误,不要慌,下面我们来解决它。
方法/步骤
-
首先,让我们看一下报错信息;
-
找到web项目所在工程;
-
在工程上右击,选择Build Path>Configure Build Path...打开,出现如下界面;
-
点击右侧Add Library...;
-
在出现的窗口中选择Server Runtime,选择Next,选择tomcat,OK;
-
好了,现在已经设置好了,让我们再看看原文件,大功告成。