当前位置:   article > 正文

Eclipse新建Web项目出现 The superclass "javax.servlet.http.HttpServlet" was not ..._the super class does not exist.

the super class does not exist.

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项目

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/55883?site
推荐阅读
相关标签
  

闽ICP备14008679号