index.jsp报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path的解决办法

1.问题

在jsp文件的开头报错:The superclass "javax.servlet.http.HttpServlet" was not found on the  Java Build Path

 2.原因分析

主要是Javaweb工程类中没有添加Web 容器Runtime相关类导致。

3.解决方法

第一:

右击项目名称->propertise->java build path->libraries->add libraries->server runtime->选择你的tomcat 服务器->finish,到这里之后java文件报的错没了。

 

第二:

切换到Java Build Path界面中的Orader and Export,选择需要用到的jar包。

3.参考文章

【1】https://www.yuanmas.com/info/nkyxAJogON.html

猜你喜欢

转载自www.cnblogs.com/lty1661489001/p/12905337.html