The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

Posted 不如来编码

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path相关的知识,希望对你有一定的参考价值。

新建WEB项目出现如下错误,可以这样来修正,

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

进入Window-preference,选择Server-Runtime Environment,

选择Add,在弹出页面上,选择本机已经安装好的Tomcat版本,next,并指定路径。

 

window-show view-server,选择添加server,把刚才添加的tomcat加入到此server中,这个时候项目中会多出来一个servers项目

 

项目属性,build path,library,add library,选择 server runtime,确定,错误取消。

以上是关于The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path的主要内容,如果未能解决你的问题,请参考以下文章