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

        今天上午使用64位Eclipse创建了一个web工程,可是当创建一个jsp时出现了“The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path”,如下图:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path_第1张图片

        如何解决呢?

        1、选中所创建的web工程并鼠标右键——>鼠标悬浮到Build Path——>点击Configure Build Path,出现下图:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path_第2张图片

2、对上图进行如下操作:找到并点击“Java Build Path”——>点击“Libraries”选项卡——>点击“Add Libray...-”按钮,出现下图:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path_第3张图片

3、选中上图“Server Runtime”然后点击“Next”按钮,出现下图:


注意:如果选中上图“Server Runtime”然后点击“Next”按钮后(如上图)一片空白,则需要设置Apache服务器。设置方法为:Window——>Preferences——>点开Server节点——>点击Runtime Environment ——> 点击“Add... ”按钮——> 选择Apache的版本后点Next,再填入Apache服务器软件的安装(解压后)地址。  

4、在上图中选择“Apache Tomcat v7.0”选项,然后点击“Finish”按钮,则回到第一步的界面,点击第一步界面中“Orader and Export”,出现下图:

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path_第4张图片

5、选中红框框起来的复选框,然后点击“OK”按钮即可。

你可能感兴趣的:(The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path)