您的位置:首页 > 编程语言 > Java开发

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

2012-04-12 00:00 459 查看
有时(我极少遇到),通过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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  eclipse index