Monday, January 19, 2009
Open Type can't find your class?
I ran into an annoying case when switching frequently between workspaces and doing some really mean things to a couple of them with swapping out external frameworks repeatedly. Somehow I managed to corrupt my type caches in Eclipse so that the Open Type dialog would just be missing some entries (which is REALLY annoying, I might add). This would also manifest as java type completion not working for the missing classes. Maybe there's a nice way in Eclipse to do this, but I couldn't find it, but you can toss your type caches. Quit Eclipse, go to workspace/.metadata/.plugins/org.eclipse.jdt.core and remove *.index and savedIndexNames.txt. When you restart Eclipse it will rebuild the entire type cache and life should be happy again.
Subscribe to:
Post Comments (Atom)
25 comments:
Nice one. That saved me an hour or two this morning. Thanks.
Thanks! I had the same issue and this worked for me as well. This also affected Open Type Hierarchy. The problem seemed to start after some serious refactoring involving moving classes from one project to another and renaming some classes.
Yupp, happens to work for me, too. And affected was also the "referenced in workspace" and the "call hierarchy".
Made my morning as well
Any idea what to do if deleting the indexes fails to fix things? In my workspace, it no longer seems to be able to figure out which classes implement which interfaces, etc.
If deleting the indexes fails to fix thing, you can also (if you use maven) do an "Maven=>Update Project Configuration" on the project where class are missing in the "open type" window.
Thanks a lot... It saved lot of time...
I am looking for an exact implementation in my project. Something like given an interface, get me all the classes which implements that interface. Any idea how to do this? This should be same as what Open Type Hierarchy does. Let me know please.
Thanks.
Triguna
Your fix is still relevant in 2012! Thank you very much! I wish I found it earlier...
Thanks, this is a really useful tip.
And also relevant on 2013 ;). I was trying everything: changing eclipse, java version (1.6, 1.7, x64, x86) and I was becoming crazy....Thank you a lot.
By the way, if you use a lot the "Open implementation" there is a very useful plugin->Implementators, you can do the same with alt + F3 and since the type hierachy wasn't working I was very sad...
Saved me from going insane. Thank you.
Thank You!! (working in Eclipse 3.7.2)
thank you!! it's working
Thanks Mike! It worked very well.
And 2014!
You should also check that little arrow on the right of the search box to see if you have selected any working sets. I had been working on multiple projects so thought it would be a good idea to filter them by working sets, but then it didn't find an entire project's worth of files. Talk about irony.
Still valid in 2015!
Also fixed slow "Open Type" and "Open Resource" dialogs
This fix still works in Eclipse Mars as of 2016-05-18. Also corrects issues with 'Show Declarations' / 'Show References' not finding all of the proper declerations / references in the workspace.
Works and saves my day 11/22/2017!
Thank you.
May work in 2020, Can not find *.index
WORKS In 2020
Post a Comment