Eclipse新建Web项目出现
The superclass “javax.servlet.http.HttpServlet” was not found on the java build path
原因:
javaweb工程项目中没有添加tomcat运行的相关类
解决方法
方法1.找到tomcat安装路径,在tomcat根目录下的lib文件夹里,有一个servlet-api.jar,将这个jar包导入到项目中即可;
方法2:(1)右击web项目->Build Path->Configure Build Path -> Libraries -> Add Library… ->Server Runtime -> Tomcat XXX->finish
(2)回到页面,刷新web项目
Eclipse新建Web项目出现 The superclass "javax.servlet.http.HttpServlet" was not ...
最新推荐文章于 2022-05-13 18:56:56 发布