【解决异常】eclipse导入项目,JSP文件报错:The superclass "javax.servlet.http.HttpServlet" was not found

【问题描述】

eclipse导入项目,JSP文件报错。

报错内容: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

 

【根因】

项目迁移后,tomcat和JRE的配置已不是原电脑的那些配置,导致基础配置出错。

【解决办法】

选择项目,点击右键,选择"Properties":

【解决异常】eclipse导入项目,JSP文件报错:The superclass "javax.servlet.http.HttpServlet" was not found

 

选择“Java Build Path”,选择“Libraries”,点击“Add Library...”,

【解决异常】eclipse导入项目,JSP文件报错:The superclass "javax.servlet.http.HttpServlet" was not found

 

增加“JRE System Library”和“Server Runtime”即可:

【解决异常】eclipse导入项目,JSP文件报错:The superclass "javax.servlet.http.HttpServlet" was not found