Eclipse报错:the superclass "javax.servlet.http.HttpServlet" was not found on the java Build Path

来源:互联网 发布:软件交付风险 编辑:程序博客网 时间:2024/06/05 18:37

在MAC上装了Myeclipse2014,试用期过了想装回10发现也不行。果断用回eclipse,装了tomcat插件后兴冲冲地开始建立个JSP测试下,发现报错。原来web工程里没有添加tomcat运行时相关类导致。

MAC OS 10.10.1+Eclipse 4.4.1

解决方法:

右键点击工程,选中Build Path--->Configure Build Path


在java Build Path中选中Libraries,再选中Add Library,选Server runtime,选tomcat(如果没有,要再Eclipse->偏好设置->Server->Runtime Environment->add)。


再返回到这个界面选Order and Export,选tomcat 就OK了。

0 0
原创粉丝点击