首页 > 编程语言 > 详细

Eclipse新建web项目出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

时间:2015-04-05 09:11:20      阅读:1364      评论:0      收藏:0      [点我收藏+]

Eclipse新建web项目出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path



新建web项目后都,jsp页面顶端出现“红色”的报错信息: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->Java Build Path -> Libraries -> Add Library... ->Server Runtime -> Tomcat Server
   (2)切换到Java Build Path界面中的Orader and Export,选择Tomcat。

注意:按以上方法操作室,若打开Server Runtime 后一篇空白,需要设置Apache服务器。
步骤:Window->Preferences ->Server ->Runtime->Environment->add->选择Apache的版本后点next,再填入你的Apache服务器软件的安装地址。

Eclipse新建web项目出现The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

原文:http://blog.csdn.net/dream_angel_z/article/details/44875213

(1)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!