Sometime Eclipse fails to work as expected. The following 'dances', in increasing order of desperation, may help. Remember to maintain a fixed grin throughout and try not to tread on your own toes.
Refresh and clean all projects ("Quickstep")
Click on a project in the Package Explorer. Hit Apple-A (or Ctrl-A) to select all projects. Hit F5 to refresh. Select Project->Clean..., select "Clean all projects", and click Ok.
Open and close all projects ("Foxtrot")
Click on a project in the Package Explorer. Hit Apple-A (or Ctrl-A) to select all projects. Right click the projects and select "Close Project". Right click the projects again and select "Open Project".
Open and close all projects restarting Eclipse in between ("Tango")
Click on a project in the Package Explorer. Hit Apple-A (or Ctrl-A) to select all projects. Right click the projects and select "Close Project". Restart Eclipse. Click on a project in the Package Explorer. Hit Apple-A (or Ctrl-A) to select all projects. Right click the projects again and select "Open Project".
Delete and re-import all projects ("Paso Doble")
Click on a project in the Package Explorer. Hit Apple-A (or Ctrl-A) to select all projects. Press the delete key, select "Do not delete contents", and click Ok. Right click in the Package Explorer and select Import..., then choose General and "Existing Projects into Workspace" and click Next. Browse to select the platform checkout directory and click Choose. Select all the projects for import. Click Finish.
Rebuild the search indices ("Slow Waltz")
Exit the workbench and delete the Java search index:
- go into
\plugins\.metadata\.plugins\org.eclipse.jdt.core - delete 'savedIndexNames.txt'
- delete all *.index
Restart
If all else fails
If you're still stuck, try the "Hokey Cokey" by repeating all of the above until you've had enough.
When using maven projects via m2e, there are a couple of extras (the combination are probably the Cha-cha-cha?):
ReplyDeleteMaven -> Update Project Configuration; Select All; Ok (and wait)
and
Maven -> Update Dependencies...; Select All; Ok (and wait)
And in a real emergency, open the Maven Repositories view and refresh the indexes on all repositories (and keep waiting).
Thanks. I'd like to see the whole set of Maven dances, quite apart from under Eclipse. ;-)
ReplyDeleteOver the years one that often saved me is the moonwalk (aka PDE dance).
ReplyDeleteStep 1 - disable auto build
Step 2 - empty the target platform
Step 3 - restart eclipse
Step 4 - select the target platform again
Step 5 - build
Note though that some partners may decide to change on you Step 2 by picking another target platform.
As for the Maven dances, they can only be practiced on the slippery floor resulting from the usage of the IDE and Maven waxes together.
Thanks for this usefull and funny post ;-)
ReplyDeleteThis is really funny cause in our team we call these Eclipse Dances too!
ReplyDeleteNice one Glyn.
ReplyDeleteHow about "Dance another day"?
ReplyDeleteOnce cleaning & rebuilding the recalcitrant project has failed to imrove things, I tend to start over with a new workspace into which I check out all projects.
Export -> Team -> Team Project Set in the bad workspace, Import ... in the new one.
I never needed it, but switching to a new/different install of Eclipse in the middle is entirely possible.
I feel the pain of these comments, but I'm disappointed that no one mentioned anything about fixing the underlying causes of these problems.
ReplyDeleteFurthermore, if there is a computational way to do this then it should be possible to execute a command which will do these things without requiring us to do them.
We spoke to Eclipse experts about these issues, but it was too hard to reproduce the failures predictably and Eclipse doesn't really have sufficiently good diagnostics to enable a bad "one off" state to be debugged, so we gave up and kept "dancing".
ReplyDeleteFortunately, or unfortunately from a debugging perspective, it is relatively rare to need any of the steps these days. Maybe I've subconsciously learned not to push Eclipse beyond its limits.
And here is the fix: use something else! Netbeans, IntelliJ Idea or even Notepad, as you wish :o)
ReplyDeleteI've used IDEA and quite like it, but the dance steps are so rarely needed in Eclipse these days that I prefer it as I know the shortcuts and it's helpful to have OSGi as a plugin system.
ReplyDeletedon't forget about the "crusty shuffle", close Eclipse, delete your entire workspace, and reopen.
ReplyDeleteThanks . This helped.
ReplyDeleteThanks! it is still helpful!
ReplyDeleteCleaning and rebuilding the project didn't work for me, but restarting eclipse with the -clean flag, followed by a rebuild did. E.g (from terminal):
ReplyDelete"C:\Program Files\eclipse\eclipse.exe" -clean
followed by (inside eclipse) Project>Build Project