为什么 Eclipse 在启动时太慢?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16953565/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 21:44:14  来源:igfitidea点击:

Why Eclipse is too slow on startup?

eclipsestartup

提问by kaushik

I am using windows 7 home premium with service pack 1 installed. I had installed JDK 1.7u21. Then I downloaded Eclipse Juno (Before that I was using Eclipse Indigo with JDK 1.6u26) and when I started it, I found out that it is taking too much time to start. It is pausing on the splash screen for more than 10 minutes, and then only asks for the workspace selection.

我正在使用安装了 Service Pack 1 的 Windows 7 家庭高级版。我已经安装了 JDK 1.7u21。然后我下载了 Eclipse Juno(在此之前我使用 Eclipse Indigo 和 JDK 1.6u26),当我启动它时,我发现它花费了太多时间来启动。它在启动画面上暂停超过 10 分钟,然后只要求选择工作区。

Then I removed Juno and installed Indigo again, also uninstalled JDK 1.7 and installed JDK 1.6u45, but now also the problem persists. When I searched, I have found that deleting files in the workspace/.metadata/.plugins/org.eclipse.core.resourceswill fix he problem. I have done that also, but no use.

然后我删除了 Juno 并再次安装了 Indigo,也卸载了 JDK 1.7 并安装了 JDK 1.6u45,但现在问题仍然存在。当我搜索时,我发现删除文件中的文件workspace/.metadata/.plugins/org.eclipse.core.resources可以解决问题。我也这样做过,但没有用。

The below given is my 'eclipse.ini'

下面给出的是我的“eclipse.ini”

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

回答by AurA

Basically, there might be too many plugins at startup which might be creating this mess. You must disable these startup plugins

基本上,启动时可能有太多插件,这可能会造成这种混乱。您必须禁用这些启动插件

Take a look at the previous post Temporarily disable Eclipse plugin

看一下之前的帖子临时禁用Eclipse插件

Another very good guide to speed up eclipse is given as under. http://www.beyondlinux.com/2011/06/25/speed-up-your-eclipse-as-a-super-fast-ide/

下面给出了另一个很好的加速 eclipse 的指南。 http://www.beyondlinux.com/2011/06/25/speed-up-your-eclipse-as-a-super-fast-ide/

A previous StackOverflow post also talks of speeding up eclipse How can you speed up Eclipse?

之前的 StackOverflow 帖子也谈到了加速 Eclipse 如何加速 Eclipse?

You can also see the list of plugins that are loaded at startup at enter image description here

您还可以看到启动时加载的插件列表 在此处输入图片说明

回答by toddkaufmann

You don't give much to go on, so I'll give a few things to try to collect additional information:

你不会做太多事情,所以我会提供一些东西来尝试收集更多信息:

  • Use JVisualVm to monitor the process and look at the threads. You can find this in the JDK bin folder. Once started, the Eclipse should appear in the left pane under 'Local', Double-click it to open then go the the threads tab and try to correlate it's behavior (running/hanging/sleeping) with particular thread activity. You might also try a 'thread dump' and see what objects threads are hanging on.

  • Use Process Monitorto trace all file, registry, and network activity during Eclipse start up try to correlate this with the behavior you see. You might also try disabling your network device(s) to see if this affects it--perhaps it is hanging while trying to contact maven or update sites.

  • Check the Eclipse log file in .metatdata/.login your workspace directory for (error) messages. This is the easiest thing to do, so look here first.

  • 使用 JVisualVm 监视进程并查看线程。您可以在 JDK bin 文件夹中找到它。启动后,Eclipse 应出现在“本地”下的左窗格中,双击它打开然后转到线程选项卡并尝试将其行为(运行/挂起/睡眠)与特定线程活动相关联。您也可以尝试“线程转储”并查看线程挂在哪些对象上。

  • 在 Eclipse 启动期间使用Process Monitor跟踪所有文件、注册表和网络活动,尝试将其与您看到的行为相关联。您也可以尝试禁用您的网络设备以查看这是否会影响它——也许它在尝试联系 Maven 或更新站点时挂起。

  • 检查.metatdata/.log工作区目录中的 Eclipse 日志文件以获取(错误)消息。这是最容易做的事情,所以先看看这里。

These are all general "information gathering" steps which may help you to ask more specific questions. Googling "why does eclipse hang during startup minutes" shows this is not uncommon, and there are few different causes/solutions.

这些都是一般的“信息收集”步骤,可以帮助您提出更具体的问题。谷歌搜索“为什么 eclipse 在启动几分钟内挂起”表明这种情况并不少见,并且几乎没有不同的原因/解决方案。