230

我正在使用 Eclipse 3.3(“Europa”)。周期性地,Eclipse 需要非常长的时间(也许永远)才能启动。我可以在 Eclipse 日志中看到的唯一内容是:

    !ENTRY org.eclipse.core.resources 2 10035 2008-10-16 09:47:34.801
    !MESSAGE 工作区退出前一个会话中未保存的更改;刷新工作区以恢复更改。

谷歌搜索显示有人建议我删除该文件夹:

workspace\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes

这似乎没有帮助。

没有从一个新的工作区开始(我不想做的事情,因为我需要几个小时才能正确设置我的所有项目),有没有办法让 Eclipse 正常启动?

4

36 回答 36

268

这可能不是您问题的确切解决方案,但就我而言,我使用SysInternals Procmon跟踪 Eclipse 轮询的文件,并发现 Eclipse 不断轮询我的一个项目的相当大的快照文件。删除它,一切都开始正常(尽管工作区处于上次启动时的状态)。

删除的文件是:

<workspace>\.metadata\.plugins\org.eclipse.core.resources\.projects\<project>\.markers.snap
于 2009-04-15T15:35:10.263 回答
236

尝试:

  1. cd 到<工作区>\.metadata\.plugins\org.eclipse.core.resources
  2. remove the file *.snap (or .markers in Indigo)
于 2009-07-05T16:36:23.287 回答
57

In my case (Juno) I had to do this:

find $WORKSPACE_DIR/.metadata/.plugins/org.eclipse.core.resources/.projects \
-name .indexes -exec rm -fr {} \;

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:

rm $WORKSPACE_DIR/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

That worked fine, without any indexes involved. Only the workbech, which I personally don't mind that much.

于 2012-09-21T10:28:04.877 回答
38

您可以尝试先从Eclipse-clean选项开始。

在 Windows 上,您可以将-clean选项添加到 eclipse 的快捷方式中。您可以在从命令行Linux启动时简单地添加它。Eclipse

于 2008-10-16T11:15:53.263 回答
35

This one works for me:

Another, and a bit better workaround which apparently works:

  1. Close Eclipse.
  2. Temporary move offending project somewhere out of the workspace.
  3. Start Eclipse, wait for workspace to load (it should).
  4. Close Eclipse again.
  5. Move the project back to workspace.

Source: Eclipse hangs while opening workspace after upgrading to GWT 2.0/Google app engine 1.2.8

于 2011-03-31T18:28:25.097 回答
31

I used eclipse -clean -clearPersistedState and that worked for me.

Warning: This may remove all projects from the workspace.

于 2014-03-21T12:07:31.547 回答
14

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.

于 2010-11-06T15:12:14.147 回答
12

I also had luck with removing the *.snap files. Mine were located in a different directory than mentioned in the posts (below).

<eclipse workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects

Consequently, the following unix cmd did the trick:

find <eclipse_workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects  -name "*.snap" -exec rm -f {} \;
于 2010-12-27T16:30:09.013 回答
8

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.

于 2013-01-17T04:22:43.830 回答
5

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

Windows -> Preferences -> General -> Startup and Shutdown -> Refresh workspace on startup

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.

于 2010-07-14T11:40:05.413 回答
3

I did this:

  1. cd to .metadata.plugins\org.eclipse.core.resources
  2. remove the file .snap
  3. Noticed the Progress tab was doing something every few seconds..it seemed stuck
  4. Exit eclipse (DO NOT FILE|RESTART HERE OR YOU HAVE TO GO BACK TO STEP 1 AGAIN)
  5. Open eclipse again.

Using -refresh or -clean when starting eclipse did not help.

于 2011-02-16T15:46:43.537 回答
3

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:

-clean
-refresh
-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
于 2014-10-13T20:35:24.243 回答
2

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.

于 2010-10-07T09:15:32.123 回答
1

Windows -> 首选项 -> 常规 -> 启动和关闭

Refresh workspace on startup检查了吗?

于 2008-10-16T19:03:52.133 回答
1

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

于 2009-08-12T16:36:16.047 回答
1

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.

  1. Impact: Excludes Add-ins support from hooking to conflicting application executable via Windows Registry Editor 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.

Updated Registry

于 2016-12-05T20:15:59.150 回答
1

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.

于 2018-03-06T02:27:19.827 回答
0

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.

于 2011-09-09T16:48:35.293 回答
0

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

于 2012-10-31T14:42:33.333 回答
0

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):

# adb devices
List of devices attached 
XXXXXX offline

I know the android device was still connected but it reported it offline. I disconnected the device and shut down the adb service:

# adb kill-server

Then I waited a few seconds and re-started the adb service:

# adb start-server

And plugged my android back in. After that, eclipse started up just fine.

于 2013-04-30T19:00:32.053 回答
0

no need to delete entire metadata file. just try deleting the .snap file from org.eclipse.core.resources on your workspace folder

ex. E:\workspaceFolder\.metadata\.plugins\org.eclipse.core.resources
于 2013-09-15T08:07:00.917 回答
0

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.

于 2013-12-07T00:56:30.233 回答
0

What worked for me was this-- On Ubuntu

  1. Ctrl+F1
  2. ps -e
  3. kill -9 for process ids of eclipse, java and adb
于 2014-03-20T12:39:03.310 回答
0

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:

  • Process Name is eclipse.exe
  • Process Name is javaw.exe
于 2014-03-26T10:10:54.413 回答
0

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 :)

于 2014-07-28T21:25:15.207 回答
0

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.

于 2014-11-03T18:50:30.307 回答
0

This may help

In your eclipse,

1) Go to Help

2) Click Eclipse marketplace

3) search - optimizer

install "optimizer for eclipse"

enter image description here

于 2015-05-18T08:59:59.083 回答
0

In Ubuntu eclipse -clean -refresh worked for me for Eclipse 3.8.1

于 2015-10-26T03:46:50.290 回答
0

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.

于 2016-01-08T13:26:49.517 回答
0

Well, I had similar behaviour while starting eclipse over X11. I forgot to tick the enable X11 forwarding in my putty.

于 2016-01-13T12:10:26.577 回答
0

In my case deleting the .metadata folder of the workspace worked. I am using Eclipse Luna service Release 2.

于 2016-01-18T04:55:30.490 回答
0

my solution is to remove this dir:

workspace/.metadata/.plugins/org.eclipse.e4.workbench

what is did was first remove (move it to a save place) all from .metadata. eclipse started all new (all my settings gone). then i added bit by bit back into the .metadata dir until it dit not work again. this way i found i only had to remove this dir. And now Eclipse started with all my settings still in place.

it seems that in the file in this dir the windows which should be opened on startup are listed and some how it could not find one off them so it hung. why i'm unclear because the file which in complained about in the logging was on my filesystem.

于 2018-01-15T13:32:09.063 回答
0

My freeze on startup issue seemed to be related to the proxy settings. I saw the username\password dialog on startup, but Eclipse froze whenever I tried to click ok, cancel, or even just click away from the dialog. For a time, I was seeing this authentication pop-up with no freeze issue.

To fix it, I started eclipse using a different workspace, which thankfully didn't freeze on me. Then I went to Window --> Preferences --> General --> Network Connections. I edited my HTTP Proxy entry and unchecked "Requires Authentication". Then I started my original problematic workspace, which launched this time without freezing. Success!

I had no further issues when I re-opened my workspace, and was able to re-enable authentication without having a problem. I didn't see the username\password pop-up anymore on start-up, so there's a chance my authentication info was FUBAR at the time.

Using: MyEclipse, Version: 2016 CI 7, Build id: 14.0.0-20160923

于 2018-03-19T15:22:32.480 回答
0

I did a lot of these solutions and none seemed to work for me. What finally did work was to restart my Mac. Duh. I noticed that my jconsole also seemed to be stuck which made me immediately go for a restart because it seemed to be Java related as opposed to Eclipse specifically.

于 2018-07-07T00:14:13.080 回答
0

JAVA VERSION COULD BE PROBLEM:

I tried few answers given above. But it didnot work. But meanwhile I was trying them it clicked to me that I switched the java version for some other stuff & forgot to switch back.

Once I jumped back to the previous version. Eclipse started working for me.

于 2020-07-28T17:47:39.053 回答
0

The freezing / deadlock can also be caused by this bug on GTK3 + Xorg

https://bugs.eclipse.org/bugs/show_bug.cgi?id=568859

Can be workarounded by using Wayland session, although in my case Eclipse fails to detect reasonable font for some reason and looks like this:

screenshot

Related:

https://www.reddit.com/r/swaywm/comments/bkzeo7/font_rendering_really_bad_and_rough_in_gtk3/

https://www.reddit.com/r/swaywm/comments/kmd3d1/webkit_gtk_font_rendering_on_wayland/

于 2021-01-08T00:10:34.767 回答