Eclipse导入web项目到新的工作空间出现The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path。

1 如下图所示的报错
导入web项目到eclipse出现The superclass javax.servlet.http.HttpServlet was not found on the Java Build Pa
2 解决方案
点击Window->Preferences->Server->Runtime Environments->右侧add添加安装的对应的tomacat->finish (如下图所示)
导入web项目到eclipse出现The superclass javax.servlet.http.HttpServlet was not found on the Java Build Pa
导入web项目到eclipse出现The superclass javax.servlet.http.HttpServlet was not found on the Java Build Pa
3 双击Servers下面的
导入web项目到eclipse出现The superclass javax.servlet.http.HttpServlet was not found on the Java Build Pa
然后选择自己对应的Tomcat并保存。
导入web项目到eclipse出现The superclass javax.servlet.http.HttpServlet was not found on the Java Build Pa
4 重新保存下报错的代码,即可解决。

相关文章: