侧边栏壁纸
博主头像
Wood Chen博主等级

独唱独酬,独行独坐还独卧

  • 累计撰写 207 篇文章
  • 累计创建 126 个标签
  • 累计收到 6 条评论

目 录CONTENT

文章目录

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

wood
2021-09-06 / 0 评论 / 0 点赞 / 3 阅读 / 909 字

原因:在 java web 工程下没有引入中间件(服务器 tomcat)运行的 library,一般只有动态网页工程才有这个报错

解决办法

(1): 确认 eclipse 中 server 的运行环境是否有配置,设置方法为:Window → Preferences → Server → Runtime Environments →Add → 选择 Apache 的版本后点 Next,再填入你 apache tomcat 软件的安装(解压后)目录。

(2): 右击 web 工程 → Build Path → Configure build path... → Java Build Path → Libraries → Add Libray... → Server Runtime →Next> → Apache Tomcat Server →Finish。

(3): 切换到 Java Build Path 界面中的 Orader and Export,勾选 Tomcat。

(4): 右击 web 工程 → 属性 → Project Facets → 点击右侧 tab 选择 Runtimes → 勾选 tomcat → OK。

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区