When Eclipse is starting to act weird or completely refuses to start, the .metadata probably got corrupted. Now what? You could delete the .metadata directory and waste a couple of hours to restore the IDE to a useful state.
Here are some tips to speed up the process a lot:
- If Eclipse still works, export your preferences.
- Try to start Eclipse with -clean. That flushes some caches which might have become corrupted.
- Start Eclipse, wait for all builds and background activity to stop and then kill it using your OS’ tools. When Eclipse restarts, it will notice it has crashed and do some more cleanup / distrust more caches.
- Install the Bulk Import plugin to save list of projects and their state.
- Instead of deleting .metadata/, rename it.
- Restore the folder “.metadata/.plugins/org.eclipse.core.runtime/.settings” from the backup. This is basically the same as the preferences. Kudos to Tomas Kramar for figuring that one out.
- Restart Eclipse. You should get an empty workspace but all your preferences should be there.
- Use the buttons in the toolbar to restore all your projects.
Another useful plugin is the “save UI state” which saves the workspace layout and open editors after every change (based on the code here).
With a way to preserve your preferences, saving the project state the workspace layout, you should be able to quickly restore the IDE.
Related articles:
- Eclipse Dance Steps – “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.”
[…] can be a couple of reasons why Eclipse refuses to start: Corrupted workspace, broken plugins or conflicting plugins. This blog post is about the last […]
[…] The metadata got corrupted. Clean it. […]
you are a F**king lifesaver.