A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© zx7660 中级黑马   /  2016-3-11 11:51  /  618 人查看  /  2 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

eclipse导入object为什么会出现   object cannot be resolved to a type   求指点

2 个回复

倒序浏览
百度的

(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.
回复 使用道具 举报
不会啊,,object的jar包去哪里找呢
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马