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
1 2 3 4 5 6 |
./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:
1 2 3 4 5 |
./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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
./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 🙂
Pingback: One Eclipse Installation and Multiple Configurations | Lorenzo Bettini
Pingback: Building an Eclipse RCP Product with Buckminster | Lorenzo Bettini
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!
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 🙂
Thank you very much for your reply! I’ll be waiting for some updates on this 🙂
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?
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
can you give any example to install using local repository file..
thank you.
Hi
to install using a local repository, you should only specify the path to the local repository by prefixing it with file:/
Pingback: Batch installation features/plugins sujet | usa5
Is it possible to have a feedback on shell about the progress of download
You should check whether the corresponding p2 application has a kind of verbose option
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?
Ok, I guess this is a known bug, as seen here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=433402
Leaving that out it works, although it is useless to me, if I can´t choose where to install the plugins.
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.
The first arg ./eclipse is actually the eclipse executable… in Windows you need to use eclipsec.exe (note the ‘c’)
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.
I wasn’t talking about installing plugins in a different locations: I was talking about bundlepools… are you familiar with that?
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.
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
I don’t think there’s such a functionality from the command line…
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
command:
I don’t see any command…
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
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.
You could use “jar:file:path/to/update-site.zip!/” (note the !/ at the end).
That’s enough, thanks a lot.
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
Jeevan, as far as I know, the dropins folder is a deprecated method…
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?
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…
Kindly provide silent installation argument for below as I am installing it via Ansible:
\eclipsec.exe -nosplash -application org.eclipse.equinox.p2.director -repository https://testng.org/testng-eclipse-update-site/ -installIU org.testng.eclipse.feature.group,org.testng.eclipse.maven.feature.feature.group
I don’t understand what you mean by “silent installation argument”