Eclipse (Galileo):为什么“初始化 Java 工具:59%”需要永远?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1841283/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse (Galileo) : Why does "Initializing Java Tooling : 59%" take FOREVER?
提问by sangfroid
New to Java and Eclipse. For some reason, the first time I load Eclipse on a given day, it freezes at "Initializing Java Tooling : 59%". Eventually, it gets past this and I can do my work. However, this "Initializing Java Tooling : 59%" stage takes a REALLY REALLY REALLY long time. Does anybody know why it does this or how to fix it?
Java 和 Eclipse 的新手。出于某种原因,我在某一天第一次加载 Eclipse 时,它冻结在“初始化 Java 工具:59%”。最终,它过去了,我可以做我的工作。然而,这个“初始化 Java 工具:59%”阶段需要非常非常非常长的时间。有谁知道它为什么会这样做或如何解决它?
回答by Eugene Kuleshov
You can take several thread dumps of the Eclipse Java process to see what plugins are being executed. Here is some infoon how to take thread dumps.
您可以通过 Eclipse Java 进程的多个线程转储来查看正在执行哪些插件。以下是有关如何进行线程转储的一些信息。
What happen is that Eclipse loads all project configurations and then for each project it initializes all declared builders. The builder loading and initialization is what takes most of the time. Some builders need to resolve and/or reload project dependencies such as jars and other projects and also check if project resources had changed. This process can also trigger initialization of builders on other projects and it may take longer depending on 3rd party plugins you are using.
发生的情况是 Eclipse 加载所有项目配置,然后为每个项目初始化所有声明的构建器。构建器加载和初始化花费了大部分时间。一些构建器需要解析和/或重新加载项目依赖项,例如 jars 和其他项目,并检查项目资源是否已更改。此过程还可以触发其他项目上构建器的初始化,并且可能需要更长的时间,具体取决于您使用的 3rd 方插件。
回答by mike g
It breaks on a per workspace basis. I have had some success removing plugin data. Usually this can be found by at:-
它在每个工作区的基础上中断。我在删除插件数据方面取得了一些成功。通常可以通过以下方式找到:-
[workspace-directory]/.metadata/.plugins
If you delete everything except:-
如果您删除所有内容,除了:-
org.eclipse.core.resources
You will keep your projects but everything else will be deleted (preferences, scm repositories ... etc.) and will need to be recreated/reimported (you will be greeted by the welcome page, but do not be alarmed).
您将保留您的项目,但其他所有内容都将被删除(首选项、scm 存储库...等)并且需要重新创建/重新导入(欢迎页面会向您致意,但不要惊慌)。
There is probably a specific set of plugin data that should be deleted, but this fixed my last occurence, and so I have nothing else against which to further hone in on the problem state ... for the time being.
可能有一组特定的插件数据应该被删除,但这修复了我最后一次出现的问题,所以我暂时没有其他可以进一步磨练问题状态的东西。
回答by Tom
Following mike's advice, I resurrected my workspace by just deleting [workspace-directory]/.metadata/.plugins/org.eclipse.jdt.core
. That directory doesn't seem to store any important information.
按照迈克的建议,我通过删除[workspace-directory]/.metadata/.plugins/org.eclipse.jdt.core
. 该目录似乎没有存储任何重要信息。
回答by Larry Battle
I had this problem and found a solution here:
我遇到了这个问题,并在这里找到了解决方案:
http://tedvinke.wordpress.com/2010/06/21/eclipse-initializing-java-tooling-hangs/Here's what I did.
http://tedvinke.wordpress.com/2010/06/21/eclipse-initializing-java-tooling-hangs/这是我所做的。
Rename the .projects folder in .metadata/.plugins/org.eclipse.core.resources
in the workspace folder. This doesn't seem to affect any project and
the .project folder will be recreated when Eclipse restarts.
回答by Tiwari
How about doing the following
如何做以下
eclipse.exe -clean
回答by user2787610
Just uncheck "Build Automatically" and force quit Eclipse. Then start it again. Project>Build Automatically - uncheck -force quit -start Eclipse
只需取消选中“自动构建”并强制退出 Eclipse。然后重新开始。项目>自动构建 - 取消选中 -force quit -start Eclipse
回答by Carl Smotricz
A more simple-minded approach than Eugene's very clever one is to remove all your plugins, one by one, keep notes, and watch performance after each removal. This should help pinpoint the plugin that's doing the big initialization. It's possible that you didn't really need that plugin after all.
一种比 Eugene 非常聪明的方法更简单的方法是一个一个地删除所有插件,保留笔记,并在每次删除后观察性能。这应该有助于查明正在进行大初始化的插件。毕竟,您可能并不真正需要该插件。
In my experience, there is often a big delay associated with source control plugins because some feel the need to check project state against the repository on startup. There may be options to control this. You can also look at what kind of label decoration is in effect; if some decoration is dependent on repository state, that could be your time waster right there.
根据我的经验,与源代码控制插件相关的延迟通常很大,因为有些人觉得需要在启动时根据存储库检查项目状态。可能有选项可以控制这一点。也可以看看效果怎么样的标签装饰;如果某些装饰取决于存储库状态,那可能是您在那里浪费时间。
Be warned that this procedure may be destructive! You probably included those plugins for a reason, and if you remove the plugins it's possible you'll lose capabilities on already present projects, and that even replacing the plugins will not necessarily restore everything in all projects to the former state. As the disk repartition people say: We assume that you have everything backed up!
请注意,此过程可能具有破坏性!您可能出于某种原因包含这些插件,如果您删除这些插件,您可能会失去现有项目的功能,即使更换插件也不一定会将所有项目中的所有内容恢复到以前的状态。正如磁盘重新分区人所说:我们假设您已备份所有内容!