Monday, September 29, 2008

Installing Eclipse 3.4.1 Despite p2

If you're, like me, one of the unlucky ones that aren't on p2's friends list (translation: Eclipse p2 provisioning causes you an endless stream of pain and suffering), then you can't install the 3.4.1 patches because p2 won't let you.

There are several ways to deal with this. One of them is to delete your workspace's .metadata, your Eclipse install and start from scratch, installing all plug-ins again, etc., always hoping that p2 doesn't mess up until you've installed everything.

The other way is a workaround. It needs a bit of disk space and discipline. Do this:

  1. Leave your original Eclipse install alone. Specifically, never ever use the menu "Software updates..." again! Never. I mean it. Disable the entry if you can.
  2. Install eclipse again in a new place. This must be a standard install (not a shared one!!!)
  3. Do not start this install! Specifically, do not attempt to add all your update sites to this base template! Just unpack it and rename the "eclipse" directory to "eclipse-template".
  4. Copy "eclipse-template" to "eclipse-install".
  5. Start eclipse-install. If you worry that you might accidentally start the template once in a while, rename "eclipse.exe" to "eclipse.exe Is this install".
  6. Download the 3.4.1 updates.
  7. Exit eclipse-install.
  8. Use your favorite file copy tool to copy all new files and directories in eclipse-install\plugins and eclipse-install\features to your working copy of eclipse.
  9. Start your working copy.

Installing and updating plug-ins works in a similar way:

  1. Delete eclipse-install and recreate it from eclipse-template.
  2. Start eclipse-install.
  3. Open the install software dialog. Add the update site. You may be tempted to add the update sites to eclipse-template. Don't do this! As soon as p2 can see more than one update site, it will eventually mess up in the dependency calculation.
  4. Install the plug-in.
  5. Create a directory for your new plug-in in the driectory "dropins" of your working copy of Eclipse.
  6. Copy the new files and directories from eclipse-install\features and eclipse-install\plugins to the new directory below "dopins" in your working copy of Eclipse.
  7. If you need to install more than one plug-in, start with step 1. After you have installed anything in eclipse-install, the Eclipse instance is tainted and shouldn't be used again.

That's all folks. At least until the p2 guys fix the many bugs in their code. Which will probably in the Eclipse release in 2010.

That's not because I believe that the p2 guys are stupid or lazy but because this kind of product just takes three years to mature and they started in 2007, so the first working version can be expected in 20010.

4 comments:

Anonymous said...

You seem to be confusing the running system and the data manipulated by it, namely the workspace. p2 never interferes with the .metadata so you should not delete this folder or you may actually loose some data.

Aaron Digulla said...

After a new install of Eclipse after the p2 update disaster, I couldn't open the workspace anymore. Eclipse would actually crash during startup. The only option left was to delete the .metadata because I had already deleted everything else.

Patrick said...

I was trying to add a few plugins to a brand new Eclipse 3.4.1 install and kept tripping over the dreaded

Unsatisfied dependency: ... requiredCapability: ... org.eclipse.equinox.p2.iu

errors. It drove me crazy.

Many, many thanks for this post!

Cinlloc said...

I became crazy with that issue too !
A great solution is to uninstall p2 and reinstall UpdateManager with this script.