引言:
eclipse新导入的项目经常可以看到“XX cannot be resolved to a type”的报错信息。本文将做以简单总结。
正文:
(1)jdk不匹配(或不存在)
项目指定的jdk为“jdk1.6.0_18”,而当前eclipse使用的是“jdk1.6.0_22”。需要在BuildPath | Libraries,中做简单调整。
(2)jar包缺失或冲突
当找不到“XX”所在的jar包时,会报这个错。解决只需要找到(ctrl+点击,可能能看到jar包名称)对应jar包导入项目即可。
另外,出现相同的XX时也会报此错。可能需要调包、解包、选删。
(3)eclipse查找项目类型策略所致
eclipse下,上述两条都对比过了,没有任何问题,可偏偏还报这错。这时,需要操作一下 Project | Clean... ,问题即可解决。原因是,机制所致。因为某些特殊原因,eclipse没能自动编译源代码到build/classes(或其他classes目录),导 致类型查找不到。
Based on the comments here, I started checking how I could make sure that my Ant build
wouldn’t interfere with my Eclipse build.
I found an option in Eclipse that clears up the problem (and is possibly more efficient than
changing the 2 build system’s output folders).
Windows–>Preferences–>Java–>Compiler–>Building–>Output folder–>
”Rebuild class files modified by others”. This exists in Eclipse 3.5; I’m not sure about earlier versions.
Checking this seems to have fixed my problems.
相关推荐
主要介绍了java eclipse 出现 xxx cannot be resolved to a type 错误解决方法的相关资料,需要的朋友可以参考下
> ★BasicNameValuePair cannot be resolved to a type > ★HttpPost cannot be resolved to a type > ★NameValuePair cannot be resolved to a type > ★HttpClient cannot be resolved to a type > ★Http cannot...
测试类报错Test cannot be resolved to a type-附件资源
主要介绍了详解 问题:HttpServlet cannot be resolved to a type的相关资料,需要的朋友可以参考下
导入工程的“The import android cannot be resolved”错误解决方法
cocos The import com.loopj cannot be resolved 是缺失了jar包。导入lib文件夹,或者刷新eclipse就好了。
JSONObject cannot be resolved to a type 是因为缺少对应的依赖包:org-json.rar 包的来源github的项目:https://github.com/stleary/JSON-java中的Readme可以找到依赖包的地址。
org.apache.commons.lang.exception.NestableRuntimeException cannot be resolved 解决 替换JAR包即可
jce.jar/jsse.jar解决The import javax.crypto cannot be resolved的问题
解决The type org.springframework.dao.support.DaoSupport cannot be resolved.bao报错
rsslib4j-0.2.jar jar包,解决java报错找不到资源包问题 The import org.gnu cannot be resolved。 报错 import org.gnu.stealthp.rsslib.*; RSSChannel、RSSException、RSSHandler、RSSItem、RSSParser
ITextRenderer cannot be resolved to a type 错误就是因为缺少这个jar包
NULL 博文链接:https://zuoqiang.iteye.com/blog/1337682
Word模板-授权委托书.wpt
JSONObject所必须要用到的6个包,他们分别是commons-beanutils-1.7.0.jar、commons-collections-3.1.jar、commons-lang-2.5.jar、commons-logging.jar、ezmorph-1.0.3.jar、json-lib-2.1-jdk15.jar
用于初学着 对错误提示的解释理解 提高学习速度 还还学习吧 希望对你有帮助
eclipse_workspace设置
在最近的java学习中,写了一些小例子,都是一些常用知识,上传希望大家下载,共同学习。
JSTL 标签 发生 uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application问题时解决方法