【JAVA WEB】“The import javax.servlet cannot be resolved" 如何解决
今天将另一台机器中MyEclipse里面的一个项目拿到我的机器上面的Java EE中来继续做的时候。
一个完好的项目导入进来后,报了两个错误。
1·The improt javax.servlet cannot be resolved
2`Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"
第一个报错是出现我的java文件中
第二个报错是出现在我的jsp文件中
首先可以明确的告诉大家,这两个错误都是因为没有导入相应的jar文件。
那么,The improt javax.servlet cannot be resolved的原因是缺少服务器运行环境
解决办法是:
在eclipse中,选择你的项目,右键选择Build Path,然后选择Configure Build Path,
然后在右边选择Libraries,选择Add External JARs,然后找到你计算机中tomcat的安装路径,在common\lib文件夹下选中”servlet-api.jar“,添加点击确定就行了。
(当然,如果你的机器没有tomcat,我想你知道该怎么做)
-------------------------------------------------------------------
那么Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"的解决办法是:
eclipse中,选择你的项目,右键选择Build Path,然后选择Configure Build Path,
然后在右边选择Libraries,选择Add External JARs,然后找到你计算机中的“jstl-1.2.jar”,添加点击确定就行了。
这个jar包的下载地址:http://download.csdn.net/download/csdn_yudong/9279459
-------------------------------------------------------------------------
更多推荐
所有评论(0)