Repairing “org.eclipse.mylyn.tasks.ui” Eclipse start-up freeze on Mac OSX

Excuse the shameless “fishing for a search string” title, but it just took me over an hour to find a fix for this so, so I’m paying it forward.

The problem

This issue appears as you start Eclipse after an incomplete shutdown on a previous session – i.e. if it was force closed. If you search for this problem you’ll see a lot of sledgehammer fixes suggested:

“Delete your workspace and reimport your projects.”

“Delete your metadata directory and reimport.”

“Delete all of the hidden files in your workspace.”

etc.

The very worst recommends completely removing Eclipse and starting again. To be clear DO NOT DO ANY OF THESE! The solution is far too aggressive, and it loses your workspace configuration settings.

The problem occurs because Eclipse quits before it is able to delete a hidden “.lock” file in the workspace metadata. Upon restart it scans the metadata and sees this lock file, and as there is no pending task to clear it in the current instance, it awaits a deletion that will never happen.

The fix

Force quit Eclipse from the Dock if it’s still hanging; the damage is done, you can’t make it worse by closing it.

Open up Terminal, and navigate to the folder that contains your Eclipse workspace, then use this line to remove the hidden file lock.

sudo rm workspace/.metadata/.lock

Next, launch Eclipse with the clean and refresh arguments, so that the instance knows to regenerate any metadata that looks weird.

cd /Users/YOUR USER NAME/Development/eclipse/Eclipse.app/Contents/MacOS
./eclipse -clean -refresh

That’s it!

If you think that this might happen a lot (or if you’re just really into scripting for fun… What?) you can record the above actions as an automator script, and create a shortcut to it in your Eclipse folder so you can quickly repair the problem again in future.

The credit for finding this fix should go to sulai on StackOverflow.com, as I learnt about it from his comment on this thread, so do head over there and up-vote their answer if it helps you.

29 Replies to “Repairing “org.eclipse.mylyn.tasks.ui” Eclipse start-up freeze on Mac OSX”

  1. Same issue happened under Luna. Deleting the .lock file did not help. I restored the prior version of the workspace/.metadata from backup. Thanks pointing out the .metadata source of the problem!

    1. Neither solution worked out of the box for me…

      But the COMBINATION DID!! Just deleting .metadata/.lock still had me hanging at startup. And the Time Machine backup still had a .lock file in there. So I tried the combination: first restoring a backup (from a time I know I WASN’T in front of the computer to mess things up 😉 ), and then deleted the .lock from the newly restored .metadata folder.

      Thanks!! It is MUCH better than re-importing all the projects back into the workspace, and then organising them back into working sets!! The past month(s) have been quite frustrating as I had to do it a few times. I even though it was because I moved my workspace to a separate drive.

      1. Glad that the information helped, even if it didn’t fix it for you right away.

        Thanks for adding what worked for you; will hopefully help others who have the same setup!

      2. Hi,
        can you please explain how you did it all step by step because I fail to do it the right way.

        1. Sorry, I’ve long-since abandoned Eclipse for IntelliJ, so don’t still have the software on hand to replicate this.

  2. Thank you so much! This was so frustrating and your solution worked like a charm!

  3. Doesn’t work in Luna… keeps hanging the same. This is just inacceptable and always happens when you need a critical fix, respecting Murphy’s law to the letter.

    What to do? the sledgehammer mindless solution? is software really that crappy in 2015?

    1. It does seem that software is getting worse lately… I just had to switch to Safari from Chrome to write this because it kept hanging after the latest update. Sorry to hear that it doesn’t work in Luna… I’ve switched entirely to IntelliJ now, and I’m not going back to Eclipse ever. It’s really a breath of fresh air using an IDE with some semblance of stability about it, with Maven support out of the box!

  4. I used to delete my metadata and then run it back . But this helps in figuring out the issue and saves hell lot of time.
    Thanks a ton 🙂

Comments are closed.