[eclipse] Open type (Ctrl-Shift-T)找不到类

本文介绍了解决Eclipse中Open Type搜索无法找到已存在类的问题。通常原因是索引损坏,解决办法是清除工作空间下的.metadata/.plugins/org.eclipse.jdt.core目录中的所有.index文件及savedIndexNames.txt文件,重启Eclipse后会自动重建索引。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转自:《http://www.eoeandroid.com/blog-91715-5053.html》


有时(我极少遇到),通过ctrl + shift + t找对应的类时,类明明存在,并且也在编译路径下,但就是查找不到,一个可能的原因就是eclipse为类建立的索引出了问题。

      解决的方法是:找到项目所在工作空间下的.metadata/.plugins/org.eclipse.jdt.core文件夹,将里面的*.index文件和savedIndexNames.txt文件删除,重启eclipse,然后eclipse会重建索引,这时问题就可以解决了。
 
解决方法来自这里: http://www.java-forums.org/eclipse/6513-open-type-ctrl-shift-t-does-not-find-types.html
 
Sometimes, the indexes that Eclipse use for searching the types, get corrupted. You can clear the Open Type indexes by going to <Workspace>/.metadata/.plugins/org.eclipse.jdt.core and deleting all files there. The indexes will be re-built the next time you use open type.

Note that this is a empirical observation, and you may delete some JDT saved data that you don't want to delete. I observed no ill effects, but for safety you could try deleting just the *.index files and the "savedIndexNames.txt", and see if it works.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值