Eclipse 类型层次结构并不总是有效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16354028/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse type hierarchy not always working
提问by Slimer
When I want to see implementation of some interface through F4(type hierarchy) or ctrl+t(quick hierarchy) or implementation of a method, I can't see it! Problem is, that it works in 90%, but I have few cases when interface and implementation are in same package and eclipse doesn't recognize it via type hierarchy. Any suggestions? Got Eclipse Indigo SR2.
当我想通过F4(类型层次结构)或ctrl+ t(快速层次结构)或方法的实现来查看某个接口的实现时,我看不到它!问题是,它可以在 90% 的情况下工作,但是当接口和实现在同一个包中并且 eclipse 无法通过类型层次结构识别它时,我很少遇到这种情况。有什么建议?得到 Eclipse Indigo SR2。
回答by MattWallace
I had this same problem and fixed it by deleting the Eclipse index cache files located in .metadata/.plugins/org.eclipse.jdt.core. Delete all .index files and savedIndexNames.txt. Do this while Eclipse is not running and then restart. This fixed the issue for me.
我遇到了同样的问题,并通过删除位于 .metadata/.plugins/org.eclipse.jdt.core 中的 Eclipse 索引缓存文件来修复它。删除所有 .index 文件和 savedIndexNames.txt。在 Eclipse 未运行时执行此操作,然后重新启动。这为我解决了这个问题。
回答by Pavel Coufal
Use Eclipse clean mode for deleting caches, look here: How to run eclipse in clean mode? and what happens if we do so?
使用 Eclipse 清洁模式删除缓存,请看这里:如何在清洁模式下运行 eclipse?如果我们这样做会发生什么?
Sometimes is good to use clean mode to prevent these types of problems.
有时使用清洁模式来防止这些类型的问题是很好的。
回答by zawdd
I also had this problem and fixed it. The reason of this problem is that when the eclipse is running, I reinstall the JDK from 1.8 to 1.6. So I close eclipse, install JDK 1.8 again, then it's OK! May it will be helpful for others.
我也遇到了这个问题并修复了它。出现这个问题的原因是在eclipse运行的时候,我把JDK从1.8重新安装到了1.6。于是我关闭eclipse,重新安装JDK 1.8,就OK了!愿它对其他人有帮助。