Eclipse “cannot be resolved to a type” error
引言:
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.
Eclipse “cannot be resolved to a type” error的更多相关文章
- (转)Eclipse “cannot be resolved to a type” error
原:http://www.cnblogs.com/xuxm2007/archive/2011/10/20/2219104.html Eclipse “cannot be resolved to a t ...
- Maven项目中提示:Eclipse “cannot be resolved to a type” error
我的解决办法是这个: 临时解决方法是:Clean项目 ********百度到的其他解决办法,统一归纳此处****************** (1)jdk不匹配(或不存在) 项目指定的jdk为“jdk ...
- Eclipse “cannot be resolved to a type”
遇到这坑爹的问题,网上各种答案. 只有这个能解决我的问题,eclipse机制问题: Eclipse “cannot be resolved to a type”
- Eclipse “cannot be resolved to a type” 错误
eclipse中遇到了“XX cannot be resolved to a type”的报错信息.网上找了些资料,本文将做以简单总结. (1)jdk不匹配(或不存在) 项目指定的jdk为“j ...
- eclipse中编译时enum出现cannot be resolved to a type错误
eclipse中编译时enum出现cannot be resolved to a type错误 通常是因为eclise使用的jdk版本的问题...默认是使用的是jdk1.5 应该去选择成jdk1.6或 ...
- "XX cannot be resolved to a type "eclipse报错及解决说明
转自:http://zhaoningbo.iteye.com/blog/1137215 引言: eclipse新导入的项目经常可以看到“XX cannot be resolved to a type” ...
- eclipse import的项目报autowired cannot be resolved to a type的错误
eclipse报autowired cannot be resolved to a type的错误,一般情况是依赖的JDK或者jar包有问题,检查build path可以排查文件,我今天遇到这个情况, ...
- (转)eclipse报错及解决说明 "XX cannot be resolved to a type "
场景:在项目开发时,一个工程引用另一个工程中的文件,出现报错“XX cannot be resolved to a type”,但是在实际通过跟踪“F3”能够找到相应的文件,最终用方法4解决. 引言: ...
- "XX cannot be resolved to a type "eclipse报错及解决
好久都没有写博了,还记得自己准备考研,结果你会发现——你永远不知道,你将会走上哪个路. 长远的目标是好的,但有些时候身不由己也迫不得已!做好自己的当下就是好的. 不论搞什么,总会遇到各种各样的问题,以 ...
随机推荐
- 解决.NET 调用JAVA WEBService服务中文乱码问题
主要代码如下: String input ="中文" C#调用代码: String str = System.Text.Encoding.GetEncoding("UT ...
- 解决Ubuntu环境变量错误导致无法正常登录
一.问题产生 配置JDK时,按照搜索到的一篇文章中的做法,修改了/etc/profile文件里的内容.在原内容保持不变的基础上,大致添加了以下内容: export JAVA_HOME=.... exp ...
- 实现一个类似Chrome新功能提示的popoup
先让我们看一下Chrome的popup是什么样的: 这个“直接搜索网页”与“在打开的标签页之间切换”就是两个功能导航,还做了一个动画效果,会不停的上下晃. 我通过WindowManager的addVi ...
- nginx的 CPU參数worker_processes和worker_cpu_affinity使用说明
Nginx默认没有开启利用多核CPU,我们能够通过添加worker_cpu_affinity配置參数来充分利用多核CPU.CPU是任务处理,计算最关键的资源,CPU核越多.性能就越好. worker_ ...
- hdu 3065 AC自动机模版题
题意:输出每个模式串出现的次数,查询的时候呢使用一个数组进行记录就好. 同上题一样的关键点,其他没什么难度了. #include <cstdio> #include <cstring ...
- 初次使用IntelliJ IDEA
一.认识IDEA IDEA 全称IntelliJ IDEA,是java语言开发的集成环境,IntelliJ在业界被公认为最好的java开发工具之一,尤其在智能代码助手.代码自动提示.重构.J2EE支持 ...
- 在mvc4里怎样引用:System.Web.Optimization和entityframework
请在nuget 里运行: Install-Package Microsoft.AspNet.Web.Optimizationinstall-package entityframework
- 〖Android〗(how-to) fix k860/k860i buletooth.
bluedroid.so for k860/k860i 1./media/Enjoy/AndroidCode/cm10.1/device/lenovo/stuttgart/bluetooth/blue ...
- Wince6.0模拟器下载和使用方法
原文地址:http://www.oogps.com/post/Wince6.0.html下载地址:Wince6.0模拟器下载.rar 第一步:把软件下载解压后看到以下目录. 第二步:双击运行上图中的S ...
- 纯CSS实现蜂窝六边形的个性相册
概述 纯CSS实现蜂窝六边形的个性相册 详细 代码下载:http://www.demodashi.com/demo/12804.html 此案例主要用到CSS3的 transform 和 transi ...