One Eclipse Installation and Multiple Configurations

I used to have many Eclipse installations in my machines; typically they were different Juno versions downloaded from ecipse.org, for instance, Eclipse for RCP developers, Eclipse for DSL developers, Eclipse Modeling Tools, etc. Moreover, most of them were customized with the same plugins (for instance, Mylyn connectors) which I had to install on all of them. I preferred to have separate installations not to have a monolithic single Eclipse instance (where some features might also interfere with each other).

Then I started to use the ability of Eclipse to deal with multiple configurations, which is really a cool feature.

The idea is that you have a single Eclipse installation with all the features you always used and that you would desire in all of your Eclipse installations; then you have different directories for each “configuration”.

You can start Eclipse with a command line like the following, which uses the command line argument -configuration:

eclipse-main/eclipse -configuration eclipse-other/configuration

Assuming that the main Eclipse installation is in eclipse-main directory, and that the new separate configuration will be stored in eclipse-other/configuration (which will be automatically created if it does not yet exist). What you get is a running Eclipse instance with all the features and plugins of the main Eclipse installation, but all the new features which will be installed from this running instance will go in the new configuration, thus they won’t disturb the main installation!

If you try to install new software from this Eclipse running instance, you’ll see that the list of available software sites is empty, so you will have to fill such list with the typical Eclipse software sites, such as http://download.eclipse.org/releases/juno and http://download.eclipse.org/eclipse/updates/4.2.

And then you can install new features in this Eclipse, and they will be available only in this configuration. You can then check the plugins and features directories in eclipse-other which will contain the new installed features and bundles (which will not be stored in the same directories of eclipse-main); similarly, the plugins and features directories in eclipse-other will not contain the features and bundles which are stored in the same directories of eclipse-main, though they are available in the new Eclipse configuration.

Of course, you’ll have to use the above command line each time you want this Eclipse version (you should have shell scripts to run a specific Eclipse).

Main advantages in this approach are

  1. The features you want to use in all configurations are stored in only one place, and they will be maintained only in the eclipse-main installation (e.g., kept up to date)
  2. you save some space in your hard disk (I had 4 Eclipse installations which required 2.5 Gb; with the new approach, i.e., one Eclipse main installation and 3 configurations I only need 500 Mb!)

If you can still use command line to install new features in the separate configurations (I blogged about that); you just need to adjust the command line with the -configuration parameter.

For instance, to have an Eclipse configuration in eclipse-texlipse/configuration (based on the main Eclipse installation stored in eclipse-main) with the addition of Texlipse and Subversion features I run these commands

./eclipse-main/eclipse \
-configuration ./eclipse-texlipse/configuration \
-application org.eclipse.equinox.p2.director -noSplash \
-repository http://download.eclipse.org/releases/juno,http://download.eclipse.org/eclipse/updates/4.2,\
http://texlipse.sourceforge.net/ \
-installIUs \
net.sourceforge.texlipse.feature.group,\
de.vonloesch.pdf4eclipse.feature.group \
-vmargs -Declipse.p2.mirrors=true -Djava.net.preferIPv4Stack=true

./eclipse-main/eclipse \
-configuration ./eclipse-texlipse/configuration \
-application org.eclipse.equinox.p2.director -noSplash \
-repository http://download.eclipse.org/releases/juno,http://download.eclipse.org/eclipse/updates/4.2 \
-installIUs \
org.eclipse.team.svn.feature.group \
-vmargs -Declipse.p2.mirrors=true -Djava.net.preferIPv4Stack=true

Note that using the command line for installing new features will also store in the Eclipse configuration the specified update sites (so you will find them in the Install New Software dialog).

Be Sociable, Share!

8 thoughts on “One Eclipse Installation and Multiple Configurations

  1. Lorenzo Bettini Post author

    Andreas, I think it’s been there for a long time but honestly I had never heard of it myself :)

    Reply
  2. Dariusz Michura

    As usually there are also some disadvantages:

    1. Eclipse runs noticeable slower when main installation is placed on a server. The best example is Run/Debug Configuration dialog. Opening it locally is rather slow and opening it in such configuration takes ‘ages’.

    2. Some plug-ins do not work when installed in separate configuration. They must be installed within main installation. I spent a lot of time to find the reason but I did not find any clues.

    Reply
    1. Lorenzo Bettini Post author

      Dariusz, can you please list some of these plugins which do not work when installed in separate configuration?

      Reply
      1. Dariusz Michura

        In my project ITS there are two plug-ins reported: SWTBot and QuickRex but I am sure there are more of them. After some time of trying to make them work we just gave up. When we encounter similar plug-in we just install it within main installation.

        Reply
        1. Lorenzo Bettini Post author

          Since I’m using SwtBot most of the time, it is installed in my main eclipse, that’s why I haven’t experienced that problem I guess :)

          Reply

Leave a Reply