Question

Eclipse has bugs. It crashes, it freezes. And even if it doesn't the underlying OS might have its problems too. It is a fact of life.

The problem is that every time the Eclipse was brutally terminated, I am forced to delete the .metadata/.plugins/org.eclipse.core.resources folder, otherwise Eclipse wouldn't load the workspace at all.

But when I do this, the Eclipse forgets about projects in project explorer. Re-importing it again is not that much hassle, but it gets more and more annoying the more projects I work on and the more frequently the Eclipse needs to be terminated.

Is there any way to prevent the need to re-import all projects? Firefox for example, when terminated brutally, doesn't need to loose the information about the current session, because there are addons (e.g. Session Manager) that can revive old working session.

Or maybe there is a way to automatically repair the broken data in .metadata/.plugins/org.eclipse.core.resources? (It might not be that easy, since all files are binary).

Or maybe there is a way to automate workspace importing? Running such a script will be a huge time-saver.

Was it helpful?

Solution

Things I would try in order:

  1. Start eclipse with -clean flag: ./eclipse -clean
  2. Delete the .lock file: workspace/.metadata/.lock
  3. Inspect the log files: workspace/.metadata/.log
  4. Delete the .snap file workspace/.metadata/.plugins/org.eclipse.core.resources/.snap
  5. If you are using eclipse4, delete workbench file: workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
  6. Delete the project .markers.snap files workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/*/.markers.snap

Edit: .snap file can be named .snap or .markers.snap depending on your eclipse version

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top