43

First thing on a morning, just after I switch on my PC (Windows XP) and start my Eclipse it simply shows the splash screen and then freezes. After about 20 minutes it will then ask me which workspace to load.

The problem was happening with 3.5 and 3.6 Eclipse. With the 3.6 Eclipse installation I only have the standard PDE install + Google plugin (for GWT development) + Subclipse.

Because I have it configured to ask me for the workspace I can see its not workspace or project related.

I suspect the Google plugin as I have not had any problems before installing this but I have searched and have not come across anybody reporting similar problems.

It only does this once - straight after I switch my machine on in the morning. After this it starts fine - typically in a few seconds.

What is it likely to be doing? How can I find out what it is doing?

pillingworth
  • 3,238
  • 2
  • 24
  • 49
  • 1
    Possible duplicate of [How do I prevent Eclipse from hanging on startup?](http://stackoverflow.com/questions/207843/how-do-i-prevent-eclipse-from-hanging-on-startup) – Steve Chambers Aug 31 '16 at 12:38

15 Answers15

116

The link @CharlesB posted led me in the right direction, but I found that you only need to delete the .snap file located here:

[Workspace Directory]/.metadata/.plugins/org.eclipse.core.resources/.snap

(Note the .metadata directory is hidden.)

Marcel Ray
  • 1,671
  • 2
  • 10
  • 14
  • 2
    This is my only "Favorited" SO post because I have to dig up the path once a month :) – David Mann Oct 19 '12 at 18:46
  • Thanks @marcelebrate your old post helps me :) – RED.Skull Nov 07 '12 at 05:10
  • This worked a treat for me, deleting the .snap file..magic. Thanks – user595985 Jan 13 '17 at 19:57
  • +1 Perfect! Was getting a hang in Luna as soon as the workspace opened. Deleting the .snap did the job. Thanks! – Kevin Hooke Jul 01 '17 at 17:46
  • FYI: for me in Eclipse Neon the .snap file didn't exist, only 72.snap, which removing it also solved the problem. Thanks! – rjcarr Oct 03 '17 at 00:07
  • Similar to rcjain, I found 42.snap file instead. I have down-voted this answer, as expect more details on the step. I get following error after mentioned step. "Could not write metadata for '/kstream_time_windowed'. [working directory]/.metadata/.plugins/org.eclipse.core.resources/.projects/kstream_time_windowed/.markers.snap (No such file or directory)" – Rohit Verma Jul 15 '19 at 13:07
  • the solution worked for me too. I add some details that may be useful: Eclipse (2019-9) has closed following the unexpected night shutdown of the pc. In the path [Workspace Directory] /. Metadata / .plugins / org.eclipse.core.resources / .snap there was the 36.snap file last modified the previous day. I made a backup of the file outside the folder and I deleted the file. Eclipse restarted successfully – Manu002 Nov 17 '21 at 09:13
  • I found `293.snap` and removed it `rm ~/eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/293.snap` Eclipse started after this. – Vitalii Blagodir Feb 02 '23 at 14:35
83

Maybe this blog post could help:

In your workspace directory perform the following steps:

  1. cd .metadata/.plugins
  2. mv org.eclipse.core.resources org.eclipse.core.resources.bak
  3. Start eclipse. (It should show an error message or an empty workspace because no project is found.)
  4. Close all open editors tabs.
  5. Exit eclipse.
  6. rm -rf org.eclipse.core.resources (Delete the newly created directory.)
  7. mv org.eclipse.core.resources.bak/ org.eclipse.core.resources (Restore the original directory.)
  8. Start eclipse and start working. :-)
CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • 2
    This indeed made eclipse work again but it emptied all my java working sets, all my projects are now moved under 'Other Projects' – sam Jun 04 '15 at 13:23
  • Perfect! This was the only solution that worked for me and didn't empty my Java working sets nor move any of my projects. – Steve Chambers Aug 31 '16 at 12:44
  • Thank you! Thankyou! Thankyou! worked like a charm!! – Aparna Jul 16 '19 at 17:27
21

I also had similar problem. Eclipse (Luna) started normally with splash screen, then opened main window and immediately freeze. For me running eclipse with

eclipse.exe -clean -refresh

fixed the problem.

Gondy
  • 4,925
  • 4
  • 40
  • 46
11

Found my problem. The Google GWT plugin does not clean up after itself and leaves lots of files in the Temp folder (C:\Documents and Settings{username}\Local Settings\Temp on XP). I had over 100000 files and several thousand folders in here - with over 99% of them due to the Google GWT plugin. I removed these and now Eclipse starts in a few seconds instead of 20 minutes. Plus my whole machine is generally running more smoothly.

pillingworth
  • 3,238
  • 2
  • 24
  • 49
  • Have had my unregistered stack overflow account merged so I can maintain this question/answer again. Accepting this answer as it was the answer to my particular problem although I accept that some of the other answers may help with other Eclipse startup slow downs. – pillingworth Apr 30 '13 at 08:12
  • Since finding this problem I raised an issue with the GWT project ([issue 5261](http://code.google.com/p/google-web-toolkit/issues/detail?id=5261)) which has since moved to [issue 74](https://code.google.com/p/google-plugin-for-eclipse/issues/detail?id=74) on the GWT plugin project. There are quite lot of comments attached to these issues that describe the problem and various workarounds. – pillingworth Apr 30 '13 at 08:12
  • I don't use GWT but your solution did the trick. I just ran Disk cleanup and chose Temporary Directory. Thanks a lot. – Hazhir Oct 22 '15 at 18:22
  • It didn't solve the problem but it does really help in loading the workspace quickly. – Pat B Apr 27 '16 at 18:51
6

I have installed Eclipse through direct download as well as Software Centre but on ubuntu 12.04 LTS they both seem to hang on splash screen unless the ~/workspace directory is deleted.

I found that by clicking on the splash screen and then pressing Enter it launches perfectly fine even without removing the ~/workspace directory!!

Ramin
  • 61
  • 1
  • 1
6

Try restarting eclipse with the -console and -consoleLog flags. This will open a console window when you can interact with OSGi and see platform output. You can put those flags in the eclipse.ini in your eclipse folder (where eclipse.exe is located). In the console window, type "ss" which will display what plug-ins are loaded and started. That could point you to the reason for the slowness. You can type start and stop to start and stop OSGi bundles. Also, make sure that there is no "-clean" in your eclipse.ini as it will cause all plugins to be reloaded and that may cause some slowness.

TK Gospodinov
  • 8,302
  • 6
  • 24
  • 25
3

While @CharlesB probably works for most people for me it doesn't as Eclipse generally corrupts an individual project (generally the last project). Thus I find for linked projects deleting the .snap and .history of what I think is the last project or the entire folder to work better:

WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/.projects/LAST_PROJ_BEFORE ECLIPSE_CRASHED

Then restart eclipse and you will see LAST_PROJ_BEFORE_ECLIPSE_CRASHED as closed. Delete it because you won't be able to open and reimport existing project into the workspace (your linked project will still have the .project).

Adam Gent
  • 47,843
  • 23
  • 153
  • 203
  • I had to nuke the whole folder inside .projects. Of course you want to back up anything before trying. This worked for me thanks. – Ben Pretorius Jun 17 '14 at 12:38
2

In my case it was freezing in the splash screen, while loading 'view.ui', after having selected the workspace. The fix was running it with: eclipse -clean -clearPersistedState

daniel sp
  • 937
  • 1
  • 11
  • 29
  • That `-clearPersistedState` fixed it for me on MacOS. What did NOT help was removing of [workspace/.metadata/.LOCK] (yes, that seems to be left over but was not the root cause). – StaxMan Mar 08 '21 at 21:30
1

Delete the .metadata folder in your local workspace (this is what worked for me). It seems that it contains a .LOCK file that if not properly closed, prevents eclipse from starting properly.

This is Perfectly working.

srikanth
  • 9
  • 2
srikanth_yarram
  • 957
  • 9
  • 16
1

For me below was fix

In eclipse.ini, make sure it is pointing to java8 with correct jvm.dll vm entry.

-vm
C:\Program Files\Java\jre1.8.0_131\bin\server\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.8
Nisha
  • 11
  • 1
0

For me deleting .snap files and renaming and restoring of org.eclipse.core.resources did not help. I had to delete .history directory inside org.eclipse.core.resources folder. After this I was able to start my eclipse.

user613114
  • 2,731
  • 11
  • 47
  • 73
0

I had a similar problem with Luna4.4.2. But it was my first time opening this Eclipse version, so there were no projects used before hence none of the above was a solution for me. I waited ~20 minutes without clicking on the frozen splash screen. Luckily "Choose Workspace" screen finally popped up, and Eclipse works fine now.

cihanyyt
  • 3
  • 1
0

For Linux users. My startup freezes stopped after I did Eclipse cache cleanup. When Eclipse was not running I did the following:

  1. Clean up all "cache" and ".cache" directories under .workspace/.plugins
  2. Clean up all "cache" and ".cache" directories under ${HOME/}/.eclipse

After that Eclipse startup time went back to reasonable 5-10 sec.

oᴉɹǝɥɔ
  • 1,796
  • 1
  • 18
  • 31
0

One can launch the DevMode JVM with an explicit tempdir specification. We use Ant to launch DevMode, and I have the following JVM arg specified:

One should be able to use the same "-D" arg if launching via the Google Eclipse plugin as well.

The tempdir we use is cleaned regularly as part of our build process, so junk file accumulation is controlled.

ShabbyDoo
  • 1,256
  • 1
  • 11
  • 20
0

Very often helps open workspace with different eclipse version, then close it and open with current version.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 21 '23 at 12:19