After loitering and latering (but no lootering!) in IRC for a few hours today, I've come to the conclusion that not enough people know about
.link files. I guess I could wiki this, but I thought I'd blog it instead.
Scenario 1: You're an Eclipse user. You use Eclipse a lot. In fact, you use multiple versions of Eclipse for testing, debugging, and even *gasp* developing. You waste a ton of time unpacking zips and running Update Manager.
Scenario 2: You use Eclipse and occasionally do something silly like deleting files outside of Eclipse or updating CVS files using commandline CVS instead of the click-click-wait method in Eclipse. (This is usually not a problem, but can sometimes lead to ...)
Scenario 3: Something Wicked This Way [Came] and your Eclipse has become corrupt. It's time to blow away your config files, .metadata files, or run with -clean. If that doesn't work you probably have to reinstall (oh crap) everything -- Eclipse + all your trusty plugins. You could also copy carefully from the busted Eclipse to the minty-fresh one, but that's both time consuming and possibly dangerous. Is there a better way?
Scenario 4: You produce a product based on Eclipse but want to keep your stuff and Eclipse's stuff separate when you bundle it all up for easier digestion by your users. Maybe for license reasons, maybe for legal reasons, maybe just for file system hygiene or to make support easier.
Scenario 5: You're a control freak and just like to keep stuff in different places according to your own particular... um... idiom.
In all of these scenarios,
.link files can help. Here's how to set one up:
- In your Eclipse install folder, create a
links/folder next to
- In your
eclipse/links/folder, create a textfile called
whatever.link. This file need only be one line, with newline and no trailing slash(es), and can be called anything ending with
- Unpack a zip full of plugins and features into the path specified in your
/home/nickb/eclipse/eclipse-plugins-phpeclipse/ eclipse/ plugins/ features/
- Start up Eclipse. Check
Help > Aboutto see if all your plugins and features are listed.
- Rinse, lather, repeat.
You can have lots of
.link files and lots of install locations, which allows you to easily swap between different versions of plugins and features for testing purposes, or to share an install location between multiple Eclipse installs. And, when you upgrade Eclipse, you can just copy the old links/ folder into the new Eclipse and voom, all your old plugins and features are there. Please note that when changing between versions of Eclipse, sometimes things will end up disabled, if the new Eclipse won't work with the old plugins. If this happens, you can easily switch back to the old one, look for an update, or download a new zip.
You can also manage your plugins inside Eclipse. So, if you prefer clicking to typing, you can convert a
.link file location into a Update Manager (UM) install location, so that you can use UM to install updates to plugins that you created by unpacking a zip, or just to reuse an existing folder for later UM installs. Here's how:
- Complete steps above. Verify all your plugins & features are properly available in Eclipse.
- To convert a linked folder to an "Extension Location" as used by Update Manager, you just have to put a single file in the eclipse/ folder inside the linked folder. Here's a sample:
$ cat /home/nickb/eclipse/eclipse-plugins-europa/eclipse/.eclipseextension id=org.eclipse.platform name=Eclipse Platform version=3.3.0
- Remove or rename the
.linkfile that references the folder you just converted so that you're not trying to add the same plugins twice.
- Start up Eclipse. Check
Help > Aboutto make sure you no longer have the plugins & features you just disabled. Then launch
Help > Software Updates > Manage Configuration > Add an Extension Locationto re-add those plugins & features.
- Restart Eclipse.