Restoring a Corrupted Workspace in Eclipse

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.”

One Response to Restoring a Corrupted Workspace in Eclipse

  1. [...] 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 [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 339 other followers