I use multiple workspaces with Eclipse. I recently noticed that some of my workspaces have a lot of cruft in them from software packages that I installed and then later removed. As far as I can tell, the situation is that many packages write stuff (sometimes a lot of stuff) to the .metadata folder for every workspace I open while the package was installed. When I removed a package, it seems to clean out the .metadata folder for the workspace that I happen to have open at the time, but all the other workspaces are left with orphaned metadata. Sometimes this metadata causes problems—often, errors while opening the workspace and sometimes instability.
The only way I know to deal with this is to create a new workspace, import projects from the polluted workspace, reconstructing all my settings (a major pain) and then delete the old workspace. Is there an easier way to deal with this?
Yes, go ahead and delete the . metadata.
One way to fix a corrupted eclipse workspace is to delete the folder <workspace location>\. metadata\. plugins\org.
metadata folder is an area where Eclipse plug-ins can save any information they want to save. This will include things like your preference settings, information about the contents of projects and the indices the Java plug-in uses to find classes and methods quickly.
You can avoid this bye de-selecting in the “Build automatically” in the preferences under General -> Workspace. If you now select Project -> Clean -> All and de-select “Start an Build automatically” in the dialog you end up with a workspace without the files of the build process.
There is no easy way to remove the "outdated" stuff from an existing workspace. Using the "clean" parameter will not really help, as many of the files you refer to are "free form data", only known to the plugins that are no longer available.
Your best bet is to optimize the re-import, where I would like to point out the following:
${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings
folder from the old to the new workspace. This is surely the fastest way, but it may lead to weird behaviour, because some of your plugins may depend on these settings and on some of the mentioned "free form data" stored elsewhere. (There are even people symlinking these folders over multiple workspaces, but this really requires to use the same plugins on all workspaces.)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With