Restoring a Corrupted Workspace in Eclipse

2. September, 2011

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:

  1. If Eclipse still works, export your preferences.
  2. Try to start Eclipse with -clean. That flushes some caches which might have become corrupted.
  3. 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.
  4. Install the Bulk Import plugin to save list of projects and their state.
  5. Instead of deleting .metadata/, rename it.
  6. 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.
  7. Restart Eclipse. You should get an empty workspace but all your preferences should be there.
  8. 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.”

Eclipse Workspace Mechanic

14. March, 2011

If you want to:

  • Create a consistent environment among groups
  • Save time setting up new workspaces
  • Make sure your favorite preferences are applied to all your current and future workspaces

then this is for you.

Related articles:


Follow

Get every new post delivered to your Inbox.

Join 340 other followers