Android Dev: Eclipse won’t start? Hangs at splash screen? Kill Mylyn…

For the last couple of months, one of our dev machines has been literally incapable of opening a simple Android project. It crashes every time, on startup, while displaying the Eclipse logo:

Screen Shot 2013-04-05 at 14.45.54

Re-installing everything had no effect. We tried everything, and the only thing that worked reliably was to keep deleting the project and re-synching from SVN every time we wanted to start Eclipse

Today I finally discovered the cause: Mylyn

Mylyn?

This is someone’s research project that they originally implemented as an Eclipse plugin. I’ve never understood why, but after a few years they – somehow – got it “embedded” into the core Eclipse downloads at http://eclipse.org . Since then it’s often been compared to a virus, given that almost every developer I know *detests* Mylyn, has no use for it, and struggles to get rid of it (the “embedding” removed your ability to uninstall Mylyn; this was not a popular decision).

Calling it a “virus” is (I hope!) clearly an overreaction – although it shows the depth of hatred a lot of programmers felt. But there is a word for unwanted, unneeded software that you force upon users, and prevent them from uninstalling:

Malware

Anyway, according to Mylyn’s supporters, the code only runs if you use it. QED if you don’t use it … it won’t *in any way* slow down or crash your Eclipse editor. O, RLY?

…Liars, Damned Liars, and … Mylyn supporters?

I’ve long suspected that most of the past 3 years of complaints “Eclipse is slow”, “Eclipse always crashes” etc are caused by Mylyn, or something similar (something added around that time). I’ve seen way too many reports of virgin Eclipse installs running very slow and crashing (as far back as 2002 Eclipse ran on old, weak machines – fast, and with no crashes – and it’s very odd for a major piece of software to actively get *worse* over time).

(NB: many reports were from Android devs, since I work in mobile right now — I’ve since discovered that Google’s Android plugin is probably responsible for many of the crashes, since Google doesn’t seem to be testing it as rigorously as you might expect. But there were plenty of reports from people who were working on non-Android projects, so it seemed there was at least *something* wrong in the core IDE)

I wasn’t looking to prove Mylyn as the cause – I just wanted to prove *any* cause, and be sure we’d never get this problem again in future.

I did this by manually deleting each piece of metadata, then restarting with “-clean”, until the crash stopped (you lose lots of core, critical data this way – but it’s the fastest way to diagnose which badly-written, untested plugin is crashing your system). Mylyn’s metadata was the only set that caused the crash.

Then I went one step further: deleting the actual libraries/binary code for each plugin, every feature, until the crash stopped (leaving the metadata alone this time). Again: it started working as soon as Mylyn was gone.

To check, I then reinstated everything from a backup, and this time *only* deleted Mylyn: machine worked perfectly, no crashes.

How to kill Mylyn with fire

So, it seems Mylyn is at fault, not just slowing down our development (adding pointless stuff that no-one uses), but – in this case – making an entire dev machine unusable. How do we fix this?

  1. Close all open copies of Eclipse
  2. Find your “Eclipse app folder” (wherever the Eclipse program lives; since Eclipse has no installer (still!) it’s wherever you chose to copy the files when you installed it originally)
  3. Burn Mylyn out of /features/
    1. Find every sub-folder of “features” that has the word “mylyn” in it – most of them are together in alphabetical order *but some are not*
    2. Delete the folders themselves
  4. Burn Mylyn out of /plugins/
    1. Find every sub-folder of “plugins” that has the word “mylyn” in it – most of them are together in alphabetical order *but some are not*
    2. Delete the folders themselves
  5. Re-start eclipse once per project, using the command-line option ” -clean” (this means: “refresh”)
    1. If you’re using OS X, this is very hard to do, and in 10 years no-one has come up with a workaround; for now, do this:
      1. Open Terminal
      2. cd /Applications/Eclipse/ (or whatever you named the Eclipse folder in your drive)
      3. cd Eclipse.app/Contents/MacOS/
      4. ./eclipse -clean
    2. (eclipse will run as per usual, you need to start it once per workspace, let the project open up, then close it down again)

Screenshots

Sort-by-name, and most of them are easy to find and destroy:

Screen Shot 2013-04-05 at 18.25.45

…but don’t forget the subtle ones (these are 3rd party projects that have Mylyn “compatibility”; if you don’t remove them, you can get errors and hangs at startups while they try to find Mylyn code they rely upon):

Screen Shot 2013-04-05 at 18.26.38

2 thoughts on “Android Dev: Eclipse won’t start? Hangs at splash screen? Kill Mylyn…

  1. Juan Cadavid

    Hi,

    I’ve been developing over Eclipse for the past 8 years, and have used Mylyn every day since it got released, and I absolutely love it. I’m having the freezing splash screen problem right now, but I’m waiting for the next milestone when I’m sure it’ll be fixed.
    Thought I’d needed to comment this on your post.

  2. adam Post author

    If Mylyn were offered as a plugin, something that individuals/teams could choose to use-or-not, it would be great.

    You could take a decision on whether the slowdown and bugs were worth the increase in development speed and ease.

    …but forcing a bad product on everyone – one that has a major effect on IDE performance – while outright lying about it, pretending it’s “nothing”? That’s awful.

    NB: Eclipse is dead. Sad to see it go (ruined by poor maintenance), but IntelliJ has got cheaper and cheaper, and every Android dev I know is in the process of switching (if they haven’t already). Eclipse team shot themselves in the head, really.

Leave a Reply

Your email address will not be published. Required fields are marked *