突然出现这个错误
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
1
考虑到是可能是项目的路径问题,因为该文件没在我的workspace中,所以尝试将project换到myeclipse下的路径当中
尝试失败
2
右击web工程-》属性或Build Path-》Java Build Path->Libraries->
Add Libray...->Server Runtime -》Tomcat Server
切换到Java
Build Path界面中的Orader and Export,选择Tomcat。
注意:
按以上方法操作时,若打开Server
Runtime后一片空白,需要设置Apache服务器。设置方法为:window->Preferences->Server->Runtime Environment -> add --> 选择Apache的版本后点Next,再填入你apache服务器软件的安装(解压后)地址。