How do I deal with a persistent problem of Eclipse hanging on my workspace?
Here's the long and short of it. Short first:
- I had an X Window System crash, which resulted in Eclipse existing uncleanly (ie, it was probably force-killed without warning.)
- When restarting eclipse, it would hang indefinitely on "Loading Workbench".
- Deleting the *.snap files in workspace/.metadata works, but then IDE fails to work properly after lunch, persumably because these files are missing.
- Deleting my workspace/.metadata lets eclipse launch and run mostly normally, but...
- When I try to save a Java file (any file), it hangs indefinitely on "User Operation is Waiting" -- "Building workspace"
So the gist is that somewhere, after the crash, there is a file or files that are causing Eclipse to hang when trying to either restore files I was editing, or deal in other ways with my workspace. Here are some relevant exceptions from my .log file:
From bullet point #2:
!ENTRY org.eclipse.core.resources 2 10035 2011-01-24 11:21:33.870
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover chan开发者_如何学运维ges.
!ENTRY org.eclipse.core.resources 8 2 2011-01-24 11:21:35.040
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 1
org.eclipse.core.runtime.CoreException: SDK is not loaded yet
at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.stopBuild(Unknown Source)
at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.abortOnBadSetup(Unknown Source)
at com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.build(Unknown Source)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
From bullet point #5:
!ENTRY org.eclipse.core.resources 8 2 2011-01-24 14:14:47.331
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 1
org.eclipse.core.runtime.CoreException: Project target not loaded yet.
at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.stopBuild(Unknown Source)
at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.abortOnBadSetup(Unknown Source)
at com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.build(Unknown Source)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2011-01-24 14:14:47.331
!MESSAGE Project target not loaded yet.
!SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2011-01-24 14:14:47.331
!MESSAGE Project target not loaded yet.
At this point, all I really want is to be able to use Eclipse in a state where it isn't crashing. Any advice short of totally deleting my entire ~/.eclipse directory, my workspace, and reinstalling Eclipse from scratch?
Try remove .snap file from <>/.metadata/.plugins/org.eclipse.core.resources/
I know you don't want this as an answer, but I would seriously consider getting another copy of Eclipse -- unless you have a lot of saved preferences, etc that you absolutely need to hold on to. Make sure to copy your workspace to somewhere else before blowing away your broken version of Eclipse.
I think this is the optimal solution in terms of saving you time. Otherwise you could tinker with settings for a while until you finally get a solution -- and even then your Eclipse could be unstable.
I deleted a few projects (already in version control) from the workspace in the file system and that seems to have fixed the problem.
Just move all your projects from your workspace to another folder then start eclipse again, it should start now. When it starts you can then import or simply move the projects back into your workspace. I think some of the projects make it throw a NullPointerException
. I'm not sure why.
When killing eclipse, you should to remove .lock
from your workspace/.metadata
. It did the trick for me.
This happened to me today and after much head scratching I rebooted and the problem disappeared...
Solved the issue for me: https://bugs.eclipse.org/bugs/show_bug.cgi?id=310625
精彩评论