Team Project Sets

October 13, 2009 at 10:01 am (Eclipse)

I’ve just discovered Team Project Sets, a very handy feature in Eclipse. A Team Project Set can be used to share the contents of a workspace with others. I can export a specification of my workspace contents (which defines the projects and working sets I have in my workspace, and the source code repositories in which my projects are stored):

File | Export | Team Project Set

Somebody else can then import my workspace contents (preferably into an empty workspace):

File | Import | Team Project Set.

Very handy! I imagine I’ll use this when I next need to change machine, or upgrade to a new version of Eclipse.

Permalink Leave a Comment

Packaging a JAR as an Eclipse plugin

June 9, 2009 at 7:05 pm (Eclipse, Java)

Occasionally, I need to package a bunch of JARs into an Eclipse plugin. Often this is so that I can depend on third-party code that does not ship with Eclipse and that can’t (or won’t) build from source.

In Ganymede, the incredibly simple way to do this is:

  1. Import the JARs into the workspace.
  2. Select and right-click the JARs.
  3. Click PDE Tools | Convert JARs to plugin project.
  4. Follow the wizard.

However, this wizard doesn’t allow you to add JARs to an existing plugin. This can be achieved manually:

  1. Import the JARs into the target plugin project.
  2. Right-click the JARs.
  3. Click Build Path | Add to Build Path
  4. Open the MANIFEST.MF file and click the Runtime tab.
  5. Click the Add button in the Exported Packages frame.
  6. Select all of the packages that you wish to be visible to downstream plugins.
  7. Save the MANIFEST.MF file.
  8. Right click the plugin project.
  9. Click Build Path | Configure Build Path.
  10. Click Order and Export.
  11. Tick all of the plugins that you wish to be visible to downstream plugins.

I hope this is useful to someone. I’ve wasted time on this twice in a month! It’s not easy to remember all of the steps in the manual process.

Permalink 2 Comments

Test-Driven Development for Epsilon

April 3, 2009 at 3:49 pm (Eclipse)

We’ve moved this post across to the Epsilon blog: read it here.

Permalink Leave a Comment

Safari – Forcing new windows to open as tabs

March 31, 2009 at 8:39 am (Mac)

I dislike that _blank links open as new windows, rather than tabs, with Safari. Here’s a simple fix. Enter this on the terminal, and restart Safari:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

From the Unofficial Apple Weblog.

Permalink Leave a Comment

Java 6.0 and Mac OS 10.5 (Leopard)

February 5, 2009 at 10:02 am (Java, Mac)

When I made the switch to Mac, I assumed that Leopard didn’t have Java 1.6:

> java -version
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

However, it seems that Java 6 is available, but to activate it, you have to dig around in Applications list:

Java preferences in Finder

Then drag and drop Java 6 to the top of the list of preferred JVMs:

Java Preferences pane on Mac OS 10.5

Permalink Leave a Comment

Exporting an RCP app to multiple platforms

January 23, 2009 at 5:59 pm (Eclipse)

Eclipse RCP apps are standalone: they don’t require an Eclipse platform to be installed. I’ve been using an RCP app to share a GMF editor with some colleagues who don’t use Eclipse. However, my colleagues use various platforms, and using Eclipse to build binaries for each of those platforms was confusing. Here’s my process:

  1. Install the Eclipse RCP delta pack, as described in my post earlier today.
  2. Create a new Product Configuration file (under Plugin Development on File | New)
  3. Fill in a name, id and version. Under application, select your RCP application. I’ve been using GMF, which automatically generates an application when the “Generate RCP app” button is checked.
  4. On the configuration tab, click the Add Required Plugins button to add a minimal set of plugins to the configuration tab.
  5. Click the Add button and add any platform-specific plugins for the platforms that for which you wish to generate binaries. Typically, just add the *swt.* plugins.
  6. On the overview screen, click the Synchronize hyperlink and then Test the product if you wish.
  7. Afterwards, generate the binaries by clicking the Eclipse product export wizard hyperlink.
  8. Be sure to check the “Export for multiple platforms” box. Click Next.

    Exporting to multiple platforms with the Eclipse Product Export Wizard

    Exporting to multiple platforms with the Eclipse Product Export Wizard

  9. Check the boxes for the platforms for which you wish to export binaries.

Resources: http://book.javanb.com/eclipse-rich-client-platform-designing-coding-and-packaging-java-applications-oct-2005/ch09lev1sec2.html

Permalink Leave a Comment

Installing the RCP Delta Pack for Eclipse

January 23, 2009 at 2:18 pm (Eclipse)

Update: This post refers to Eclipse 3.4 (Ganymede). Eclipse 3.5 (Galileo) was released earlier this month. The process for installing the delta pack is slightly different in Eclipse 3.5, and is described by Andrew Niefer (via Lubos’s excellent list of Eclipse plugin and RCP development resources).

I recently wanted to deploy an Eclipse product to platforms other than my development platform. Most Eclipse plugins are platform-independent, but some are not. When you download an Eclipse distribution, it only includes the plugins required to run Eclipse on your operating system. The Eclipse RCP delta pack contains the plugins required to run Eclipse on all (supported) operating systems.

I couldn’t find any detailed instructions on how to install the RCP delta pack, this was my process:

  1. Determine which drop of Eclipse is installed. From the “About Eclipse Platform” menu item, I ascertained that I had installed:
    Version: 3.4.1
    Build id: M20080911-1700
  2. Visit the corresponding release build on the Eclipse downloads website. For the details above, the URL was:http://download.eclipse.org/eclipse/downloads/drops/R-3.4.1-200809111700/index.php
  3. Download the RCP delta pack, usually filed in the Delta Pack category. In this case, the file was called eclipse-3.4.1-delta-pack.zip
  4. Unzip the archive file. It should contain an eclipse directory with one feature and several plugins.
  5. Close Eclipse.
  6. Overlay your Eclipse installation with the files from the archive. Replace any files when prompted.
  7. Restart Eclipse. You may need to use the -clean option.
  8. Under the Preferences menu item, select Plug-in Development | Target Platform. Click the Reload button.
  9. Ensure that the list of plug-ins includes plugins for platforms other than your operating system. (i.e. Ensure that the list includes org.eclipse.equinox.launcher.carbon.macosx, org.eclipse.equinox.launcher.gtk.linux.x86, org.eclipse.equinox.launcher.win32.win32.x86, etc).If these plug-ins aren’t listed, try clicking the Reset button.

Permalink 3 Comments