您的位置:首页 > 理论基础 > 计算机网络

解决办法:错误异常The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

2017-07-14 18:26 931 查看
问题描述:我在创建maven web后,将普通web项目转换为Dynamic
Web项目后,index.jsp中最顶端html中出现了The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path错误异常

原因分析:在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。

  解决方案来源于Stack Overflow,原文地址如下

  >>>> https://stackoverflow.com/questions/22756153/the-superclass-javax-servlet-http-httpservlet-was-not-found-on-the-java-build
注:本文原创由`bluetata`发布于blog.csdn.net、转载请务必注明出处。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐