The superclass "x", determined from the Dynamic Web Module facet version (3.0)

问题遇到的现象和发生背景

拿的别人的代码包,运行jsp文件开头就报错
The superclass "javax.servlet.http.HttpServlet", determined from the Dynamic Web Module facet version (3.0), was not found on the Java Build Path

img

我的解答思路和尝试过的方法

这是已经导入的jar包

img

尝试了在运行时使用本地环境但还是报错

img

  • 去掉上面那个,这两个应该冲突了

img

没有正确配置tomcat会出现这个问题,解决方法:
1、右击web工程->属性或Build Path->Java Build Path->Libraries-> Add Library...->Server Runtime ->Tomcat Server
2、切换到Java Build Path界面中的Orader and Export,选择Tomcat

如果tomcat已配置正确,可能是版本的问题,可以看下这个解决方法,跟你的描述一样:https://blog.csdn.net/mmmm0584/article/details/114705608

望采纳 望采纳 望采纳!!!!!!!!!!!!