简体   繁体   中英

How do I deal with a persistent problem of Eclipse hanging on my workspace?

Here's the long and short of it. Short first:

  1. I had an X Window System crash, which resulted in Eclipse existing uncleanly (ie, it was probably force-killed without warning.)
  2. When restarting eclipse, it would hang indefinitely on "Loading Workbench".
  3. Deleting the *.snap files in workspace/.metadata works, but then IDE fails to work properly after lunch, persumably because these files are missing.
  4. Deleting my workspace/.metadata lets eclipse launch and run mostly normally, but...
  5. 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 changes.

!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?

尝试从<> /。metadata / .plugins / org.eclipse.core.resources /删除.snap文件

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.

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.

这件事今天发生在我身上,经过多次头疼,我重新启动,问题就消失了......

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM