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

问题描述:

我们在用Eclipse进行Java web开发时,可能会出现这样的错误:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path。我们该怎么解决这个问题呢?

问题原因:

  原来Javaweb工程类中没有添加 Tomcat运行时相关类 导致。尤其是导入项目的时候最容易出现。

解决办法:

  下面是具体的解决方法:

  1、右击 web工程 --> 属性或Build Path --> Config Build Path... --> Java Build Path --> Libraries --> Add Library... --> MyEclipse Server Library --> Apache Tomcat v8.5

 

 

 完成后,错误消失。

posted @ 2019-11-22 10:03  Kaspar_Choo  阅读(215)  评论(0编辑  收藏  举报