引言:

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目录),导致类型查找不到。

(完结)

本文转自:http://zhaoningbo.iteye.com/blog/1137215

cannot be resolved解决方法的更多相关文章

  1. NDK xxxxx could not be resolved解决方法

    Type '*****' could not be resolved Method '******' could not be resolved     问题解决   以下为未尝试方法,如果上面方法解 ...

  2. the import XXXX cannot be resolved 解决方法

    明明XXX类完全没问题 突然就报错了 解决方法: 原因一:一个项目引用了兄弟项目的类,报错The import XXX cannot be resolved 解决办法:需要在引用的兄弟项目右键选择Ma ...

  3. 项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved 解决方法

    Error: The import javax.servlet cannot be resolved The import javax.servlet.http.HttpServletRequest ...

  4. The import ....cannot be resolved 解决方法

    1:右击项目build path>configure build path>libraries看有没感叹号什么的不正常的lib,移除掉 2:点击项目的build path>confi ...

  5. 错误/异常:The project cannot be built until build path errors are resolved 和 Unbound classpath container: 'JRE System Library [JavaSE-1.7]' in project 'MyJavaCode';的解决方法

    错误1: The project cannot be built until build path errors are resolved 解决方法: 把java的类库加载进去即可,在工程上右键 选择 ...

  6. The remote name could not be resolved问题的解决方法

    网站如果绑定了代理ip,内部跳转的时候,就会报The remote name could not be resolved错误,这个错误很难排查,网上也没有多少可参考的例子 现在记录下解决方法,以备参考 ...

  7. javax.servlet.ServletException cannot be resolved to a type错误解决方法

    在页面中使用全局路径时${pageContext.request.contextPath}出现javax.servlet.ServletException cannot be resolved to ...

  8. 关于Quartus II 13.0对应开发NIOS II软件程序时报错Symbol 'NULL' could not be resolved问题的解决方法

    关于Quartus II 13.0对应开发NIOS II软件程序时报错Symbol 'NULL' could not be resolved问题的解决方法 近期在评估使用NIOS II处理器进行项目的 ...

  9. IP address '121.41.35.30' could not be resolved: Name or service not known解决方法

    IP address '121.41.35.30' could not be resolved: Name or service not known解决方法 添加如下 然后重启 即可解决<pre ...

随机推荐

  1. C#操作Redis List 列表

    /// <summary> /// Redis 列表 /// </summary> public static void Redis_List() { RedisClient ...

  2. [转]让ASP.NET Web API支持$format参数的方法

    本文转自:http://www.cnblogs.com/liuzhendong/p/4228592.html 在不使用OData的情况下,也可以让ASP.NET Web API支持$format参数, ...

  3. Backup Log

    使用Backup Log 命令可进行数据库的事务日志备份.其语法格式如下: Backup 数据库名 To 备份设备 和备份数据库操作一样

  4. 06.密封类 sealed

    sealed   修饰 密封类是不能被继承的. 密封类是可以去继承别的类. namespace _07.密封类 { class Program { static void Main(string[] ...

  5. Collections自定义List排序规则

    Collections自定义List排序规则 //这里的顺序,是我自己定义的一个List<String> String[] regulation = {"jams",& ...

  6. 1.JDBC基础

    JDBC全称Java Database Connectivity,即Java数据库连接.(以下以MySQL为例,使用MySQL语句) Sun公司提供了标准JDBC API接口,没有实现具体类.各个数据 ...

  7. javascript检查数据中是否存在相同的元素

    这里是两个用于数组中查找重复元素的demo,可以看看啦 <!DOCTYPE html><html lang="en"><head> <me ...

  8. mockjs

    首先还是那句话,进来的GodBoy and GoodGirl 不妨看完再离开.  一个走在路上的前端攻城狮-along 一.mock的由来 mock有“愚弄.欺骗”之意,在前端领域,mock可以理解为 ...

  9. 【转】46 个非常有用的 PHP 代码片段

    1. 发送 SMS 在开发 Web 或者移动应用的时候,经常会遇到需要发送 SMS 给用户,或者因为登录原因,或者是为了发送信息.下面的 PHP 代码就实现了发送 SMS 的功能. 为了使用任何的语言 ...

  10. 基础架构之Maven私有库

    Maven对于Java开发来说肯定不会陌生,由于各种问题,公司常常需要搭建自己的私有Maven仓库. (一)  环境要求 Centos 7.5.1804 Docker 18.06.1-ce sonat ...