Installing Eclipse Features via the command line

If you have many eclipse installations (with different features/plugins) and you want to have such installations in several computers (possibly with different operating systems or with different architectures), then being able to install eclipse features from the command line might be quite helpful (at least, it is for me :)

You can find some related posts, like Lars Vogel’s or Paul Webster’s. These are just my two cents :)

What you need to do is to run eclipse from the command line (if you’re using Windows, you need to run eclipsec.exe, note the final ‘c’, instead of eclipse.exe), with these parameters

./eclipse \
-clean -purgeHistory \
-application org.eclipse.equinox.p2.director \
-noSplash \
-repository <repo1>,<repo2>,<repo3> \
-installIUs <feature1>,<feature2>,<feature3>,...

Where the repo URLs are just the same as the ones you use as update sites or p2 repositories when installing a feature in Eclipse (you may want to always put the eclipse distribution main update site, e.g., http://download.eclipse.org/releases/juno), while the feature IDs are the actual identifiers of features you want to install; knowing the correct feature ID might not be immediate to discover, if you’re only used to the names you see in the update manager.

For instance, say that you want to install Xtext SDK, from the site http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ , then in Eclipse you would do something like in the following screenshot

but instead of “Xtext SDK“, in the command line, you should specify org.eclipse.xtext.sdk.feature.group. While in this case it was easy to infer the feature ID, but… at least for me, it was not immediate to know that “Eclipse Java EE Developer Tools” feature is indeed org.eclipse.jst.enterprise_ui.feature.feature.group !!! :)

Fortunately, you can get to know that by clicking that “More…” link in the above screenshot, which leads you an information dialog where you can easily find the identifier of the selected feature:

Of course you can also have the list of all the contents of an update site, by using the option -list:

./eclipse \
-clean -purgeHistory \
-application org.eclipse.equinox.p2.director \
-noSplash \
-repository <repo1> -list

For instance, this is the command line I use to install in the Xtext eclipse distribution (http://www.eclipse.org/Xtext/download.html) additional stuff like the Xpand SDK, some Mylyn connectors, SwtBot and EMF CDO:

./eclipse \
-clean -purgeHistory \
-application org.eclipse.equinox.p2.director \
-noSplash \
-repository \

http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/,\


http://download.eclipse.org/releases/juno,\


http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site,\

http://update.atlassian.com/atlassian-eclipse-plugin/e3.8 \
-installIUs \
org.eclipse.xpand.sdk.feature.group,\
org.eclipse.swtbot.eclipse.feature.group,\
org.eclipse.swtbot.eclipse.test.junit4.feature.group,\
org.eclipse.swtbot.feature.group,\
org.eclipse.swtbot.forms.feature.group,\
org.eclipse.swtbot.ide.feature.group,\
org.eclipse.egit.mylyn.feature.group,\
org.eclipse.mylyn.bugzilla_feature.feature.group,\
org.eclipse.mylyn.builds.feature.group,\
org.eclipse.mylyn.context_feature.feature.group,\
org.eclipse.mylyn.discovery.feature.group,\
org.eclipse.mylyn.gerrit.feature.feature.group,\
org.eclipse.mylyn.git.feature.group,\
org.eclipse.mylyn.github.feature.feature.group,\
org.eclipse.mylyn.hudson.feature.group,\
org.eclipse.mylyn.ide_feature.feature.group,\
org.eclipse.mylyn.java_feature.feature.group,\
org.eclipse.mylyn.monitor.feature.group,\
org.eclipse.mylyn.pde_feature.feature.group,\
org.eclipse.mylyn.tasks.ide.feature.group,\
org.eclipse.mylyn.team_feature.feature.group,\
org.eclipse.mylyn.trac_feature.feature.group,\
org.eclipse.mylyn.wikitext_feature.feature.group,\
org.eclipse.mylyn_feature.feature.group,\
org.eclipse.emf.cdo.sdk.feature.group,\
org.eclipse.emf.query.sdk.feature.group,\
com.atlassian.connector.eclipse.jira.feature.group \
-vmargs -Declipse.p2.mirrors=true -Djava.net.preferIPv4Stack=true

The final -vmargs are just some additional arguments which you may want to skip.

Hope this helps :)

Be Sociable, Share!

7 thoughts on “Installing Eclipse Features via the command line

  1. Pingback: One Eclipse Installation and Multiple Configurations | Lorenzo Bettini

  2. Pingback: Building an Eclipse RCP Product with Buckminster | Lorenzo Bettini

  3. Miguel CL

    Hello Lorenzo,

    Thank you for the post, I was looking for this to automate the installation process of Eclipse. I’m trying to do this in Ubuntu but it seems there is a bug in p2 that causes problems with the signatures and this method cannot be used (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=255518). Have you found some work aorund on this? Tahnk you!

    Reply
    1. Lorenzo Bettini Post author

      Hi Miguel
      I haven’t experienced such problem (but I haven’t been using Indigo for some time: only Kepler)…
      By the way, I’m working on an easier solution for installing Eclipse from the command line… stay tuned :)

      Reply
  4. Sander De Canck

    I have tried using this method to install a plugin from a local repository but can’t seem to get it to work. Are there any changes that should be made using a local repository?
    Also no more logs pop up in the \SDP\configuration folder so I assume my command is correct is there any other way to possibly check this?

    Reply
    1. Lorenzo Bettini Post author

      And you get no error?
      However if you have a local repository, you must make sure to specify it using file:/ otherwise p2 won’t pick it up.
      Please let me know if this solves your problem

      Reply

Leave a Reply