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报错及解决
好久都没有写博了,还记得自己准备考研,结果你会发现——你永远不知道,你将会走上哪个路. 长远的目标是好的,但有些时候身不由己也迫不得已!做好自己的当下就是好的. 不论搞什么,总会遇到各种各样的问题,以 ...
随机推荐
- C++实现委托机制(一)
1.引言: 如果你接触过C#,你就会觉得C#中的delegate(委托)十分灵巧,它的用法上和C\C++的函数指针很像,但是却又比C\C++的函数指针更加灵活.并且委托可以一对多,也就是可以注册多个函 ...
- java中构建同时兼容linux和windows程序时遇到的文件路径分割符问题解决方案
最近在做一个自动上传文件的客户端,因为 file.getAbsolutePath() 在Mac和linux下的分割符是“/”,而在windows操作系统下的分割符则是“\”,我们程序中固然可以通过调 ...
- 使用IntelliJ IDEA开发Spring MVC HelloWorld
https://blog.csdn.net/industriously/article/details/52851588 https://blog.csdn.net/slow_wakler/artic ...
- UNIX网络编程读书笔记:套接口选项
概述 有很多方法来获取和设置影响套接口的选项: getsockopt和setsockopt函数 fcntl函数 ioctl函数 getsockopt和setsockopt函数 这两个函数仅用于套接口. ...
- tarjan+缩点+强连通定理
C - Network of Schools Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I ...
- ant design pro (十六)advanced 权限管理
一.概述 原文地址:https://pro.ant.design/docs/authority-management-cn 权限控制是中后台系统中常见的需求之一,你可以利用我们提供的权限控制组件,实现 ...
- postgres时间转换函数
函数 返回类型 描述 例子 to_char(timestamp, text) text 把时间戳转换成字串 to_char(current_timestamp, 'HH12:MI:SS') to_ch ...
- execve 系列函数
exec系列函数(execl.execlp.execle.execv.execvp) 1带 p 的exec函数:execlp,execvp,表示第一个参数path不用输入完整路径,只有给出命令名即可, ...
- Apache Directory Studio
Apache Directory Studio 是一个 LDAP 的工具平台,用来连接到任何 LDAP 服务器并进行管理和开发工作.主要功能:LDAP浏览器.LDIF编辑器.嵌入式 ApacheDS. ...
- [精]Oracle APEX 5.0 入门教程(一) Form表单
Oracle APEX Tutorial for Beginners (APEX 5.0) 1- Introduction 2- Create Workspace 3- Work with Works ...