Eclipse中新建Maven Web项目报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Bu...
2020-02-03 23:55
609 查看
在maven web项目中的index.jsp中的错误信息如下:
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
从错误信息可以看出来,找不到该类,也就是说找不到相应jar包。
所以解决方法就是引用相应jar包即可。
前提:
需要设置Server Runtime,
Window -> Perferences -> Server -> Runtime Environments -> Add -> Apache Tomcat ... , 这样一步步做下去即可。
此问题解决方法:
工程右键 -> Build Path -> Configure Build Path -> Libraries -> Add Library -> Server Runtime -> 选择通过上面上面步骤添加的server即可, 最后点击Apply。
就可以看到jsp页面上的错误消失。
但是你还会发现,工程上有一个小红叉,解决如下:
首先查看Markers信息 (Window–>show veiw–>Markers)
错误信息是:
Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix.
按提示步骤做即可解决问题!(工程右键 -> Maven -> Update Project)
转载于:https://www.cnblogs.com/FocusIN/p/7897035.html
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- Eclipse新建web项目出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- Eclipse中新建Maven Web项目报错:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 问题:Eclipse新建web项目出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build P
- maven新建web项目提示The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 每次建项目后新建的jsp都出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 关于eclipse新建web项目,提示:"The superclass "javax.servlet.http.HttpServlet" was not found on the Java"解决办法
- maven新建web项目提示The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- Eclipse的jsp页面出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- eclipse:报错信息The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- Maven项目红色叹号+JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java B
- eclipse:报错信息The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- 关于eclipse提示:"The superclass "javax.servlet.http.HttpServlet" was not found on the Java"解决办法
- 新建maven项目后, jsp页面报错,The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build
- Maven构建WEB项目JSP报The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- maven项目里的jsp报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 新建jsp页面"The superclass "javax.servlet.http.HttpServlet" was not found on the Java"解决办法
- 将一个现有maven项目导入时index.jsp报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java
- Eclipse: The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- eclipse:报错信息The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path