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

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:

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:

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

Hope this helps 🙂

34 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
        1. Lorenzo Bettini Post author

          Hi
          to install using a local repository, you should only specify the path to the local repository by prefixing it with file:/

          Reply
  5. Pingback: Batch installation features/plugins sujet | usa5

  6. Danny

    I´m not really sure what your first arg (./eclipse) is for, but I got an error on it and just removed it from the command.
    Still I am failing, though. What I tried ist to use the “-shared” option poiting to some local folder for a test. What I got was a NullPointerException on the canWrite method call of the DirectorApplication. Any help on this?

    Reply
      1. Lorenzo Bettini Post author

        You may want to try to use -shared only for installing the main product, e.g., org.eclipse.sdk.ide, without any additional feature (remember that if you use -shared, it means that you want to use bundle pools. I assume that’s what you want. So you also need to specify a profile and the bundlepool location). After the main product is installed, you can simply install the additional features by using the eclipse executable of the new installed product, without any further shared, bundlepool arguments, since that eclipse installation already knows about that. That’s what I do with an ant script, which I still haven’t blogged about.

        Reply
    1. Lorenzo Bettini Post author

      The first arg ./eclipse is actually the eclipse executable… in Windows you need to use eclipsec.exe (note the ‘c’)

      Reply
  7. Danny

    Can you please provide a full example installing some plugin to a different location than the standard plugins folder for Windows? I´m really deperate on this one. I picked some really small plugin to test with, which consists of only one jar, but don´t get it working, because some dependecy can not be satisfied ( Missing requirement: Goto Editor 1.3.4 (org.jf.gotoeditor 1.3.4) requires ‘bund
    le org.eclipse.core.runtime.compatibility 0.0.0’ but it could not be found).
    Here´s what i have:
    eclipsec -clean -purgeHistory -application org.eclipse.equinox.p2.director -noSplash -repository http://emacs-java.github.io/eclipse_goto_editor/update-site -installIUs org.jf.gotoeditor.site -profile SDKProfile -bundlepool C:\Appl\PluginTest\clTest -destination C:\Appl\eclipse -shared C:\Appl\PluginTest\clTest -verifyOnly

    My eclipse (Mars) is under “C:\Appl\eclipse”, destination for the plugin should be “C:\Appl\PluginTest\clTest”.

    Thank you.

    Reply
    1. Lorenzo Bettini Post author

      I wasn’t talking about installing plugins in a different locations: I was talking about bundlepools… are you familiar with that?

      Reply
  8. Danny

    Hi,
    I am not really familiar with bundlepools (, yet). If you told me it was a solution for my “problem” I´d read up on it.

    Reply
  9. ds

    Hi,
    I have downloaded BIRT4.6 update site and I am trying to install BIRT on eclipse neon in offline mode from command line using org.eclipse.equinox.p2.director application and installIU feature but I get the below error
    Software being installed: Eclipse BIRT Report Designer XML Tab Editor 4.6.0.v201606072122 (org.eclipse.birt.report.designer.editor.xml.wtp.feature.group 4.6.0.v201606072122)
    Missing requirement: Apache Batik Bridge/GVT/Scripting 1.6.0.v201011041432 (org.apache.batik.bridge 1.6.0.v201011041432) requires ‘bundle org.apache.batik.css [1.6.0,1.7.0)’ but it could not be found
    Cannot satisfy dependency:
    From: Apache Batik Transcoder 1.6.0.v201011041432 (org.apache.batik.transcoder 1.6.0.v201011041432)
    To: bundle org.apache.batik.bridge [1.6.0,1.7.0)
    If I try to install the same from eclipse ui, I see Eclipse Remediation Page where I have an option to select ‘keep my installation the same and modify the items being installed to be compatible’ where I can bypass the error and get the installation done.
    Is there a way(command/property) where I can bypass the error and get the installation done from command line.
    Thanks in advance

    Reply
      1. ds

        Thanks for the reply !
        Can you please let me know the command to install BIRT from command line offline.
        I have downloaded 4.6 update site of BIRT and pointing that as pluginPath in the below command.
        I am currently using the below command:

        I get the above mentioned dependency error when executing this command

        Reply
  10. Wendell Nichols

    Thanks for the quick reference for the p2 installer. I would also like to install a feature from an archive of an update site (one I’ve build from source). Is there a way to code the repository argument to accept a file/dir/archive?
    Thanks again
    Wendell Nichols

    Reply
    1. Lorenzo Bettini Post author

      You can always specify a directory using “file://…” but I have no idea how to specify a zip file… you might want to ask on the p2 forum.

      Reply
  11. jnsunkersett

    The information of installing from the command line was great.
    But with so many plugins and features everyone will end up with a custom eclipse installation.

    Eclipse comes with .\dropins folder but that has to be used manually
    (download your plugin as a zip, explode it into the \dropins folder and create a file .eclipseextension – note the starting DOT and restart eclipse)

    Could these be done by the eclipse install manager OR command-line ?

    PS: I found that by making the default .\features & .\plugins inside the eclipse installation – READ-ONLY – the new plugins-features get installed, inside a .eclipse folder in the HOME directory of the user – so they can be zipped up and above steps followed manually.

    thanks
    Jeevan

    Reply
  12. Uma

    Hi Lorenzo, my question is completely off topic. Sorry about that. I have eclipsec application (Scripting.exe) which in turn runs javax.js scripts (javascript). The scripts would connect to DB and get some extracts. I need a coverage report for this application, we are using jacoco. Can I do this? If so, how would I go about it? Any ideas please?

    Reply
    1. Lorenzo Bettini Post author

      You could have added this comment to one of my posts on code coverage…

      JaCoCo is only for Java code, thus you can’t use it to coverage Javascript…

      Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.