Pimp Your Eclipse
Reading about Martin Fowler's pain in installing some Eclipse-based plugins I noticed one gem of information that probably needs to be more widely known, and that's about managing extensions in Eclipse.
I'd prefer to use IDEA on a project, especially on a large code-base, but with every release Eclipse gets that little bit better, to the point where it's actually not a bad place to be most of the time and has some novel features that make it even nicer. As an example, try hitting ctrl-3 in Eclipse 3.3 for a QuickSilver-like list of actions that could be performed from where cursor is right now.
Firefox allows the user to add new features by downloading and installing new features as "extensions". Eclipse also allows users to add new features and capabilities by downloading and installing "extensions" --- same word, same concept. Of course, Eclipse ships with a lot of functionality right out of the box (downloaded archive?) but being able to add new capabilities allows you to work more efficiently, and means that those of us with a deep love of the new and shiny can always pimp our IDE.
Eclipse is typically installed by simply unpacking the ZIP it was downloaded as and running the Eclipse binary directly. As an aside, this is a blissful way to install software; I'd much rather this than an installer script shoving files in new and interesting places on my hard drive, not least because it means I can check my IDE into my source control system. By default, Eclipse will install new plugins into its own directory structure. The problem is that it's now Not Terribly Easy(tm) to tell where the original Eclipse ends and the enhancements begin, making it hard to upgrade Eclipse itself. To get around this, Eclipse has the concept of "extension locations". These are directories that are also scanned by Eclipse for extensions, and they're extremely easy to set up.
Suppose you want to create one of these things? How do you go about it? Simply create a new directory, let's call it "eclipse-extensions" because we're feeling powerfully original. You could call yours "Fred" or anything you like. It really doesn't matter.
What does matter is that this directory has a sub-directory called "eclipse", which is turn has two sub-directories "plugins" and "features". The "eclipse" directory must also contain an empty file called ".eclipseextension". This can be hard to create a Windows box, which views that name as a file extension and gets a little huffy that you've not given the file a proper name. At this point, I normally break out the command shell and use some strong "rename-fu", but you're an intelligent person and can probably imagine a million different ways of doing this. Me? I'm already up to five different ways, and I've not stopped fiddling with iTunes to try and get it to play something other than hits from the 80s.
Now that the directory structure is in place, just fire up Eclipse, and go to the "Help->Software Updates->Management Configuration" screen. Right-click on the "Eclipse SDK" entry in the tree view on the left-hand side and choose to "Add->Extension Location" In order to add a certain air of mystery to the process, I'll not give away the ending, but I'll hint that you probably want to point towards "Fred"....
Once everything's in place, just remember to ensure that all extensions are installed into your brand spanking new extension location, which is an option when installing through Eclipse's wizards. Congratulations! You can now upgrade Eclipse without fear of forgetting which extensions you've already installed. Of course, you'll also have that sense of horror when the extension that makes your life worth living suddenly stops working as eclipse's internal extension API changes again, but that's a different problem and one that you'd have to face anyway.
Posted in: /java