`

The import javax.servlet cannot be resolved

 
阅读更多

      这几天一直被myeclipse乌龟一样的速度困扰,遇上上网下载了eclipse for javaee,速度得到了保证,但是在将以前myeclipse下面的项目文件import到eclipse for javaee中之后,提示错误:The import javax.servlet cannot be resolved。这是为什么呢?原来是缺少了servlet-api.jar包,个人认为是myeclipse帮我们“做了太多的事情”了,甚至不用我们手动的导入这个包,对于这个问题有两种解决方法:

1、上网下载servlet-api.jar这个包,复制到项目中,再build path-->configure build path-->library-->add jars添加这个包

2、这个包可以直接在你的tomcat里面找到,在%tomcat_home%/lib/setvlet-api.jar,再通过build path-->configure build path-->library-->add external jars进行添加;或者直接把他复制到项目中,用上面的方法添加。

分享到:
评论

相关推荐

    javax.servlet-api-3.1.0-sources.zip

    下地址https://repo1.maven.org/maven2/javax/servlet/javax.servlet-api/3.1.0/ 各个版本都有 javax.servlet-api-3.1.0-sources.jar

    详解 问题:HttpServlet cannot be resolved to a type

    4. 多条"The import javax.servlet cannot be resolved": 指出IDE找不到`javax.servlet`包,该包包含了Servlet API的核心类和接口。 这些错误的原因通常是因为Eclipse没有配置正确的Servlet运行环境,即没有关联到...

    java eclipse 出现 xxx cannot be resolved to a type 错误解决方法

    Java Eclipse 出现 "xxx cannot be resolved to a type" 错误解决方法 Java Eclipse 是一个功能强大且广泛使用的集成开发环境(IDE),但是在使用过程中可能会出现各种错误信息,例如 "xxx cannot be resolved to a...

    servlet-api.jar

    编写websocket时需要导入包,在Eclipse中编写servlet时出现"The import javax.servlet cannot be resolved" 问题解决办法

    websocket-api.jar

    websocket-api.jar下载,websocket必备jar包,在Eclipse中编写servlet时出现"The import javax.servlet cannot be resolved" 问题解决办法

    SHOP++3源码部署

    1. 如果在导入项目后,代码出现类似“The import javax.servlet cannot be resolved”的错误提示,这通常意味着项目缺少必要的JAR库。 2. 解决方法是,在项目上右键选择“Properties” -> “Java Build Path” -> ...

Global site tag (gtag.js) - Google Analytics