Saturday, June 18, 2005

Found: Solution to Eclipse Plugin Failure

In a previous article, "Eclipse Annoyance - Failures with Plugin Development using Eclipse 3.1", I documented a problem with starting up a plugin project (any plugin project) with the first two release candidates of Eclipse 3.1. It turns out that moving from milestone 7 (M7) to the first release candidate (RC1) changed the internals a bit. One of the new features of Eclipse 3.1 is that when you update Eclipse you no longer blow away your settings. You workspace is now seperate from your Eclipse installation. For Windows and Linux your workspace by default is placed in your login or home area. Eclipse 3.1 keeps the metadata that defines everything in your environment separate from Eclipse proper itself and in this workspace. This has been great for all the milestones in Eclipse 3.1 I've tested, because it was so simple to just delete the older Eclipse installation and unpack (unzip) the new Eclipse. I could then start it up and carry on.

That was great as long as nothing critical changed. But something critical did change and the older metadata poisoned the newer Eclipse runtime environment, causing plugin startup to fail. I got a big clue to the problem when I installed the latest, Eclipse 3.1 RC3, on two other systems besides my notebook. One was Windows XP SP2, and the other was Fedora Core 4. Both installations allowed me to create and to immediately launch plugin projects. But when I upgraded to RC3 on my notebook, sure enough, it failed. That's when I decided to restart the notebook Eclipse and point it at a blank workspace. Bingo. I could create plugin projects and they would launch without failure. That meant that I would have to move all my projects over to the new workspace, but that turned out to be straightforward, and once added back into my project explorer, everything continued to work just as it had before.

With one notable exception. I have two Eclipse projects, one based on Openmap, and the other based on a complex SWT/JFace application I've been working on. Most of the information about a project is in the project directory. However, other critical information, specifically information needed to run the application, is in the metadata directory. When I trashed the original workspace, I lost my run settings for those applications as well. There is no reason why all information about a project shouldn't be in the project directory. That way, you can truly move projects around the file system, or even between Eclipse users, without losing any critical information. Those projects will have a better chance to work as intended.

6 comments:

  1. Hi, have you posted that to some Eclipse newsgroup? Or have you found anything that would enable me to use my old workspace? I am experiencing about the same problem here (I am able to create and launch a new Hello World plugin but I am not able to launch my old plugins) and I am not too keen on manually migrating my workspace. Thanks and regards, Thomas

    ReplyDelete
  2. I got it. Seems like the set of plugins you have to activate changed in the run configuration:

    In "Run... > Plug-ins > Choose Plug-ins and fragments to launch from the list" I activated all of them (some were not activated) and my plug ins launch again.

    HTH, Thomas.

    ReplyDelete
  3. Hi, how did you put openmap inside eclipse? (and on what OS?)

    Thanks
    -Ben

    ReplyDelete
  4. Hi, how did you combine Openmap and Eclipse?

    ReplyDelete
  5. hi, how did you combine openmap and eclipse?

    ReplyDelete
  6. No, I never ported OpenMap into Eclipse as a plugin. I was never satisfied with the results. Instead I've got it (mostly) working in NetBeans. I gave up with Eclipse. I'm just too stupid, I guess.

    ReplyDelete

All comments are checked. Comment SPAM will be blocked and deleted.

Note: Only a member of this blog may post a comment.