一、背景

今天直接用eclipse打开一个项目,结果报错The superclass “javax.servlet.http.HttpServlet” 。
经过一番了解大概是没配置好tomcat。

二、解决办法

1.右击出现错误的文件夹,选择build path的configure path…
解决J2EE出现...was not found on the Java Build Path的错误

2.在右边的Libraris的右边选择add librariy
解决J2EE出现...was not found on the Java Build Path的错误

3.找到
server runtime,点进去选择对应版本的tomcat就可以了。
解决J2EE出现...was not found on the Java Build Path的错误

三、小结

太久不用J2EE~做笔记还是很方便的~tomcat的版本记得要对应jdk版本。

相关文章: