报错信息:
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
solution:
First:确认Apache服务器已设置
若没有设置,步骤如下:window->Preferences->Server->Runtime Environment -> add --> 选择Apache的版本,Next,再填入你apache服务器软件的安装地址
Second:确认Apache服务器已设置后还是报错
右击web工程、属性或Build Path->Java Build Path->Libraries-> Add Libray->Server Runtime->Tomcat Server
附:如若配置Apache时遇见版本不匹配报错The Apache Tomcat installation at this directory is version 8.5.4. A Tomcat 8.0 installation is expected.时,解决方法如下:tomcat->lib下,解压缩打开catalina.jar文件,之后找到catalina.jar\org\apache\catalina\util下面的ServerInfo.properties文件,记事本打开做出如下图所示修改即可。
(由于自己在实际操作中遇到此类问题,并花了一些时间解决,便将其整理分享。仅供参考。)