Jsp页面报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java

转载请标明出处:http://blog.csdn.net/wu_wxc/article/details/51836297 本文出自【吴孝城的CSDN博客】

Eclipse创建jsp后报错Multiple annotations found at this line:- The superclass “javax.servlet.http.HttpServlet” was not found on the JavaBuild Path- The superclass “javax.servlet.http.HttpServlet” was not found on the JavaBuild Path


这里写图片描述

是因为缺少servlet-api.jar右击项目文件,选择Build Path–>Configure Build Path…–>Libraries如果没有Apache Tomcat,就点击Add Library–>Server Runtime–>Next–>选择Apache–>Finish,刷新项目看看错误是否消失。

如果有Apache Tomcat就点击Add Library…–>User Library–>Next–>User Libraries–>New…–>名字随便写–>ok–>Add External JARs…–>找到你Apache安装路径下的lib目录,选择servlet-api.jar–打开–>ok–>Finish–>ok,好了,问题解决
这里写图片描述
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容