如何防止 Eclipse 在启动时挂起?
我正在使用 Eclipse 3.3(“Europa”)。 有时,Eclipse 需要花费非常长的时间(也许永远)来启动。 我在 Eclipse 日志中唯一能看到的是:
!ENTRY org.eclipse.core.resources 2 10035 2008-10-16 09:47:34.801 !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
谷歌搜索显示 有人建议我删除该文件夹:
workspace\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes
这似乎没有帮助。
除了从一个新的工作区开始(这是我不愿意做的事情,因为我需要几个小时才能正确设置所有项目),有没有办法让 Eclipse 正确启动?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(30)
这可能不是您问题的确切解决方案,但就我而言,我跟踪了 Eclipse 使用 SysInternals Procmon,发现 Eclipse 不断为我的一个项目轮询相当大的快照文件。 删除它,一切都启动正常(尽管工作区处于上次启动时的状态)。
删除的文件是:
This may not be an exact solution for your issue, but in my case, I tracked the files that Eclipse was polling against with SysInternals Procmon, and found that Eclipse was constantly polling a fairly large snapshot file for one of my projects. Removed that, and everything started up fine (albeit with the workspace in the state it was at the previous launch).
The file removed was:
尝试:
try:
就我而言(朱诺),我必须这样做:
那就成功了。
最初我认为这是 Mylyn 的问题(在我开始使用其通用 Web 连接器后,我经历了这些冻结),但即使在卸载连接器,甚至删除 .mylyn 目录后,问题仍然出现。
编辑:我还设法通过仅删除一个文件来重新启动 Eclipse:
效果很好,不涉及任何索引。 只有workbech,我个人不太介意。
In my case (Juno) I had to do this:
That did the trick.
Initially I thought it was a problem with Mylyn (I experienced these freezes after I started using its generic web connector), but the problem appeared even after uninstalling the connector, and even deleting the .mylyn directories.
Edit: I also managed to restart eclipse by deleting just one file:
That worked fine, without any indexes involved. Only the workbech, which I personally don't mind that much.
您可以尝试先使用
-clean
选项启动Eclipse
。在 Windows 上,您可以将
-clean
选项添加到 Eclipse 的快捷方式中。 在Linux
上,您只需在从命令行启动Eclipse
时添加它即可。You can try to start
Eclipse
first with the-clean
option.On Windows you can add the
-clean
option to your shortcut for eclipse. OnLinux
you can simply add it when startingEclipse
from the command line.这个对我有用:
另一种更好的解决方法显然有效:
来源:升级到 GWT 2.0/Google 应用引擎 1.2.8 后,Eclipse 在打开工作区时挂起
This one works for me:
Another, and a bit better workaround which apparently works:
Eclipse
.Eclipse
, wait for workspace to load (it should).Eclipse
again.Source: Eclipse hangs while opening workspace after upgrading to GWT 2.0/Google app engine 1.2.8
我使用了 eclipse -clean -clearPersistedState ,这对我有用。
警告:这可能会从工作区中删除所有项目。
I used
eclipse -clean -clearPersistedState
and that worked for me.Warning: This may remove all projects from the workspace.
我在 3.5 中遇到了类似的问题,工作空间相当大,而且在任何地方都看不到 .snap 文件。 “
Windows
->首选项
->常规
-> 启动和关闭 -> 启动时刷新工作区”似乎是一个工作区相关设置,因此我无法更改导致挂起的工作区。使用命令行参数 -refresh 运行 eclipse ,然后更改设置似乎可以解决问题。
I had a similar problem with a rather large workspace in 3.5 and no .snap-files anywhere to be seen. "
Windows
->Preferences
->General
-> Startup and Shutdown -> Refresh workspace on startup" seems to be a workspace-related setting and so I couldn't change it for the workspace that was causing the hang.Running
eclipse
with the command line parameter -refresh and then changing the setting seems to do the trick.我也很幸运地删除了 *.snap 文件。 我的目录位于与帖子中提到的不同的目录中(如下)。
因此,下面的 unix cmd 就成功了:
I also had luck with removing the *.snap files. Mine were located in a different directory than mentioned in the posts (below).
Consequently, the following unix cmd did the trick:
我尝试了该线程中的所有答案,但没有一个对我有用 - 快照文件不行,移动项目不行,没有一个。
奇怪的是,有效的方法是将所有项目和 .metadata 文件夹移到其他地方,启动 Eclipse,关闭它,然后将它们全部移回来。
I tried all of the answers in this thread, and none of them worked for me -- not the snap files, not moving the projects, none of them.
What did work, oddly, was moving all projects and the .metadata folder somewhere else, starting Eclipse, closing it, and then moving them all back.
由于我在 .metadata.plugins\org.eclipse.core.resources 文件夹(在 OS X 上运行)中没有 .snao 或 .prefs 文件,所以对我来说,诀窍是复制.project文件夹复制到old.project,启动Eclipse,检查
正如 matt b 所建议的 。 之后,我关闭了 Eclipse,将文件夹 old.projects 重命名回 .projects,之后一切又恢复正常了。
Since I don't have a .snao or .prefs file in .metadata.plugins\org.eclipse.core.resources folder (running on OS X), what did the trick for me was copy the .project folder to old.project, start Eclipse, and check
as proposed by matt b. After that, I closed Eclipse, renamed the folder old.projects back to .projects and after that everything worked fine again.
我这样做了:
启动 Eclipse 时使用
-refresh
或-clean
没有帮助。I did this:
Using
-refresh
or-clean
when starting eclipse did not help.在 Mac OS X 上,可以通过双击 Eclipse 应用程序来启动 Eclipse。 如果需要将参数传递给 Eclipse,则必须编辑 Eclipse 应用程序包内的 eclipse.ini 文件:按住 Control 键的同时选择 Eclipse 应用程序包图标。 这将向您显示一个弹出菜单。 在弹出菜单中选择“显示包内容”。 在 Contents/MacOS 子文件夹中找到 eclipse.ini 文件,然后使用您喜欢的文本编辑器打开它以编辑命令行选项。
在文件开头添加:“-clean”和“-refresh”,例如:
On Mac OS X, you start Eclipse by double clicking the Eclipse application. If you need to pass arguments to Eclipse, you'll have to edit the eclipse.ini file inside the Eclipse application bundle: select the Eclipse application bundle icon while holding down the Control Key. This will present you with a popup menu. Select "Show Package Contents" in the popup menu. Locate eclipse.ini file in the Contents/MacOS sub-folder and open it with your favorite text editor to edit the command line options.
add: "-clean" and "-refresh" to the beginning of the file, for example:
检查工作区启动器是否未在您的电视或其他第二台显示器上打开。 这发生在我身上。 症状看起来与所描述的问题相同。
Check that the Workspace Launcher hasn't opened on your TV or some other second monitor. It happened to me. The symptoms look the same as the problem described.
是否选中
启动时刷新工作区
?Is
Refresh workspace on startup
checked?我刚刚在 Eclipse 启动时遇到问题。 通过删除此文件已修复此问题:
rm org.eclipse.core.resources.prefs
我在 .settings 中找到
I just had problems with Eclipse starting up. It was fixed by deleting this file:
rm org.eclipse.core.resources.prefs
I found in .settings
安装后 UFT 导致 RDz(基于 Eclipse)出现问题
即使环境变量已就位并具有相应的值,这些建议也可以解决这种情况。
注意:冲突的应用程序在 java 上下文中不会被识别,因为它被排除在 java 支持机制之外。
要求:应用程序必须由 EXE 文件启动,Java.exe/Javaw.exe/jpnlauncher.exe 除外
说明
: 找到与加载项支持冲突的应用程序的可执行文件名。 使用任务管理器或 Microsoft Process Explorer。
b. 打开 Windows 注册表编辑器。
C。 导航至:HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\JavaAgent\Modules
对于 Windows x64 上的 32 位应用程序: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercury Interactive\JavaAgent\
Modules 使用冲突软件可执行文件 nmae 的名称创建一个 DWORD 值,并将该值设置为 0。
UFT causing issues with RDz (Eclipse based) after install
These suggestions will allow to work around this situation even with the environment variables in place and with corresponding values.
Note: Conflicting application will not be recognized in a java context because it is being excluded from the java support mechanism.
Requirement: The application must be started by an EXE file, except Java.exe/Javaw.exe/jpnlauncher.exe
Instructions:
a. Locate the executable filename of the application conflicting with add-in(s) support. Either use the Task Manager or the Microsoft Process Explorer.
b. Open Windows Registry Editor.
c. Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\JavaAgent\Modules
For 32bits applications on Windows x64: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercury Interactive\JavaAgent\Modules
d. Create a DWORD value with the name of the conflicting software executable filenmae and set the value to 0.
删除 *.snap (我的是 *.markers)、--clean-data 或移动工作区文件夹似乎对我不起作用。
当我安装并将键盘输入切换到 HIME 后,我的 Eclipse 停止工作,我回到 fctix 并且它工作了。
Removing *.snap (mine is *.markers), --clean-data or move workspace folder seems all did not work for me.
As my eclipse stopped working after I installed and switched my keyborad input to HIME, I went back to fctix and it worked.
我没有快照文件。 浏览帮助菜单安装列表,至少 90% 的插件的卸载按钮被停用,所以我无法通过那里处理它。 在启动/关闭下,大多数插件未列出。 相反,我必须手动从插件文件夹中删除项目。 哇,现在对我来说启动时间快多了。 因此,如果其他一切都不起作用并且您有一次性插件,那么这可能是最终的解决方案。
I had no snap files. Going through the help menu installation list, at least 90% of my plugins had the uninstall button deactivated so I could not handle it through there. Under startup/shutdown most of plugins were not listed. Instead, I had to manually remove items from my plugins folder. Wow, the startup time is much faster for me now. So if everything else does not work and you have plugins that are disposable, this could be the ultimate solution to use.
不幸的是,这些解决方案都不适合我。 我最终必须创建一个新的工作区,然后将现有项目导入到新的工作区中。 不幸的是,这样做时您会丢失您的首选项(因此,请记住在更改设置时导出您的设置!)
Unfortunately, none of these solutions worked for me. I ended up having to create a new workspace, then imported the existing projects into the new workspace. Unfortunately, you lose your preferences when doing so (so, remember to export your settings anytime you change them!)
我在 Fedora 18 上的 eclipse (Juno) 上遇到了非常类似的问题。在调试 Android 会话的过程中,eclipse 结束了调试会话。 我尝试重新启动 Eclipse,但它一直在启动屏幕上。 我尝试了上面的各种建议但没有成功。 最后,我检查了 adb 服务(android 调试桥):
我知道 android 设备仍然处于连接状态,但它报告它已离线。 我断开了设备并关闭了 adb 服务:
然后我等了几秒钟并重新启动了 adb 服务:
并将我的 android 重新插入。之后,eclipse 启动得很好。
I had a very similar problem with eclipse (Juno) on Fedora 18. In the middle of debugging an Android session, eclipse ended the debug session. I attempted to restart eclipse but it kept haning at the splash screen. I tried the various suggestions above with no success. Finally, I checked the adb service (android debug bridge):
I know the android device was still connected but it reported it offline. I disconnected the device and shut down the adb service:
Then I waited a few seconds and re-started the adb service:
And plugged my android back in. After that, eclipse started up just fine.
无需删除整个元数据文件。 只需尝试从工作区文件夹中的 org.eclipse.core.resources 中删除 .snap 文件
no need to delete entire metadata file. just try deleting the .snap file from org.eclipse.core.resources on your workspace folder
请注意 {WORKSPACE-DIR}/.metadata/.plugins 文件夹中的零字节 .plugin 文件。 我刚刚删除了其中的一个,它解决了我的冻结问题。
Watch out for zero-byte .plugin files in the {WORKSPACE-DIR}/.metadata/.plugins folder. I just deleted one in there and it fixed my freezing issues.
就我而言,类似的症状是由一些带有大量垃圾系统文件的流氓 git 存储库引起的。
如上所述,通用补救措施是使用进程监视器来发现有问题的文件。 设置以下 2 行过滤器非常有用:
In my case similar symptoms were caused by some rogue git repository with a ton of junk system files.
Universal remedy, as mentioned above, is to use Process Monitor to discover offending files. It's useful to set the following 2-line filter:
在 Mavericks 上更新 eclipse 后,我遇到了类似的问题。 最终我发现在 eclipse 插件目录中 com.google.gdt.eclipse.login jar 的末尾有版本号。 我从名称中删除了版本号,一切都开始顺利:)
I had a similar problem after I updated eclipse on Mavericks. Eventually I found that in the eclipse plugins directory the com.google.gdt.eclipse.login jar had version numbers at the end. I removed the version number from the name and it all started fine :)
另请参阅 http://www.lazylab .org/197/eclipse/eclipse-hanging-on-startup-repair-corrupt-workspace/
99% 推荐的解决方案有效......(即删除 .snap 文件)但如果它不起作用,那么我们有尝试删除索引文件夹和进一步的工作台文件夹。
Also look at http://www.lazylab.org/197/eclipse/eclipse-hanging-on-startup-repair-corrupt-workspace/
99% Recommended Solution works.... (i.e. Removing .snap file) But if it did not worked then we have to try to remove indexes folder and further workbench folder.
这可能会
在您的 Eclipse 中有所帮助,
1) 转到帮助
2) 单击 Eclipse 市场
3) 搜索 - 优化器
安装“optimizer for eclipse”
This may help
In your eclipse,
1) Go to Help
2) Click Eclipse marketplace
3) search - optimizer
install "optimizer for eclipse"
在 Ubuntu 中 eclipse -clean -refresh 为我的 Eclipse 3.8.1 工作
In Ubuntu
eclipse -clean -refresh
worked for me for Eclipse 3.8.1如果您使用的是 Eclipse,它也可能是由 此 bug 引起的4.5/4.6、早于 v2.9.0 的 Eclipse Xtext 插件版本以及特定的工作区配置。
解决方法是创建一个新的工作区并导入现有项目。
It can also be caused by this bug, if you're having Eclipse 4.5/4.6, an Eclipse Xtext plugin version older than v2.9.0, and a particular workspace configuration.
The workaround would be to create a new workspace and import the existing projects.
好吧,我在 X11 上启动 eclipse 时也有类似的行为。 我忘记在我的 putty 中勾选启用 X11 转发。
Well, I had similar behaviour while starting eclipse over X11. I forgot to tick the enable X11 forwarding in my putty.
就我而言,删除工作区的 .metadata 文件夹是有效的。 我正在使用 Eclipse Luna 服务版本 2。
In my case deleting the .metadata folder of the workspace worked. I am using Eclipse Luna service Release 2.