uninstall eclipse features by command line - eclipse

Installing eclipse features by command line is well known[1].
However, I have a problem to uninstall eclipse features by command line.
I use the following command.
/opt/eclipse/eclipse \
-repository \
http://download.eclipse.org/releases/neon,\
https://dl.google.com/eclipse/plugin/4.6,\
http://pydev.org/updates"
-application org.eclipse.equinox.p2.director \
-uninstallIU \
org.eclipse.egit.feature.group,\
org.eclipse.mylyn_feature.feature.group,\
org.eclipse.help.feature.group
The output is the following.
Uninstalling org.eclipse.egit.feature.group 4.4.1.201607150455-r.
Uninstalling org.eclipse.mylyn_feature.feature.group 3.21.0.v20160914-0252.
Uninstalling org.eclipse.help.feature.group 2.2.1.v20161124-1400.
However, when I start the eclipse, the plugins still there.
Any help?
[1] http://blog.vogella.com/2012/04/04/installing-eclipse-features-via-the-command-line-with-the-p2-director/

Make sure to run the p2 garbage collector after uninstallation of the features.
You can run the GC manually from the command line with a command like:
eclipse -application org.eclipse.equinox.p2.garbagecollector.application
-profile SDKProfile
Plug-in jar remains after feature uninstall

Related

Installing eclipse plugin via command line [Windows]

i wanted to install a eclipse plugin via the command line and not with the eclipse gui and not with the dropin folder.
i found out that it is possible with this command:
eclipsec.exe -application org.eclipse.equinox.p2.director
-repository http://download.eclipse.org/releases/helios/
-installIU org.eclipse.cdt.feature.group
-tag AddCDT
but i have no idea how the command looks like when i download the plugin as .zip and install it from my local C: drive
e.g my plugin folder looks like this:
C:\MyPlugin\
\plugins\
\features\
......xml
many thanks
Use something like:
-repository jar:file:/C:/temp/your_zipped_plugin.zip!/
(found this from https://www.ibm.com/docs/en/wdfrhcw/1.4.0?topic=eclipse-silent-installation)

How to uninstall an Eclipse plugin via command line?

I recently installed Bravo Editor plugin into my Eclipse and it has crashed the installation of Eclipse, now I'm unable to start it.
I've already tried to call it from the command line with eclipse -clean, but it's no use.
I'd like to know how it could be uninstalled from the command line.
You can try using Eclipse Director and put com.beck.ep.feature.group as argument for -uninstallIU
The full command for this is:
eclipse -application org.eclipse.equinox.p2.director -uninstallIU com.beck.ep.feature.group
(Use eclipsec.exe on Windows.)
You can list the installed features to find the right ID with:
eclipse -application org.eclipse.equinox.p2.director -listInstalledRoots

How to install list of eclipse plugins from a script?

I need a way to setup a highly customized eclipse coding environment in a fully unattended way from a script in linux. The customized eclipse environment requires the installation of about 10 different plugins from various sources (protobuf, pydev, cmakeed, openinterminal, egit, yaml, webpageeditor, etc). Doing this manually each time with the gui takes 20-30 minutes. I want to automate the install of plugins in a script so anyone running linux can recreate my eclipse environment with a custom set of plugins without human interaction. Anyone have advice about how to do this?
Here are the command line snippets to install some of my favorite plugins (tested on Eclipse Indigo 3.7)... The trick is to figure out the value of the "installIU" parameter for the package... The Eclipse GUI will show this if you click on "more" link when the desired package is selected in the installer window.
cmakeed - CMake editor
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://cmakeed.sourceforge.net/eclipse/ -installIU com.cthing.cmakeed.feature.feature.group
OpenInTerminal - Add option in context menu
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://eclipse-openinterminal.googlecode.com/svn/trunk/site/ -installIU OpenInTerminal.feature.group
protobuf-dt - Google Protobuffer editor
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/,http://protobuf-dt.googlecode.com/git/update-site -installIU com.google.eclipse.protobuf.feature.group
yedit - YAML Editor
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://dadacoalition.org/yedit -installIU org.dadacoalition.yedit.feature.group
shelled - Bash Script Editor
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://download.eclipse.org/technology/dltk/updates/,https://sourceforge.net/projects/shelled/files/shelled/update/ -installIU net.sourceforge.shelled.feature.group
Web Page Editor
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/ -installIU org.eclipse.jst.webpageeditor.feature.feature.group
Pydev
Pydev is tricky because it requires installing a certificate first... Here's a script that automates that step:
#!/usr/bin/python
# Add PyDev's certificate to Java's key and certificate database
# Certificate file here: http://pydev.org/pydev_certificate.cer
import os, sys, pexpect, urllib2
def main():
# NOTE: You may have to update the path to your system's cacerts file
certs_file = '/usr/lib/jvm/default-java/jre/lib/security/cacerts'
pydev_certs_url = 'http://pydev.org/pydev_certificate.cer'
print "Adding pydev_certificate.cer to %s" % (certs_file)
pydev_cert = open('pydev_certificate.cer', 'w')
pydev_cert.write(urllib2.urlopen(pydev_certs_url).read())
pydev_cert.close()
cmd = "keytool -import -file ./pydev_certificate.cer -keystore %s" % (certs_file)
child = pexpect.spawn(cmd)
child.expect("Enter keystore password:")
child.sendline("changeit")
if child.expect(["Trust this certificate?", "already exists"]) == 0:
child.sendline("yes")
try:
child.interact()
except OSError:
pass
print "done"
if __name__ == "__main__":
main()
Then you can run:
eclipse -nosplash -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/indigo/,http://pydev.org/updates/ -installIU org.python.pydev.feature.feature.group
You can use the p2 director application to install Eclipse features with a script. Here are some more links that may help.

Installing plugin into eclipse using command line

I have an update site, and got the directory which contains the features and plugins
How to install the plugin in eclipse application using the command line ?
I want to automate this process
You can invoke p2 director application using something like this:
eclipsec.exe
-application org.eclipse.equinox.p2.director
-repository http://download.eclipse.org/releases/galileo/
-installIU org.eclipse.cdt.feature.group
-destination d:/eclipse/
-profile SDKProfile
Here is also link to p2 wiki.

Run plugin updates outwith Eclipse UI

I'm trying to update the plugins for an Eclipse Galileo SR2 installation from the command line.
Something similar to this command (which asks for a specific feature):
java -jar org.eclipse.equinox.launcher_*.jar -application org.eclipse.update.core.standaloneUpdate -command update
Does anyone know if a command exists using p2 or any other Eclipse application runner?
I was able to upgrade Eclipse Classic Galileo from SR1 to SR2 using the following command:
java -jar plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-application org.eclipse.equinox.p2.director
-installIU org.eclipse.sdk.ide
-uninstallIU org.eclipse.sdk.ide
-artifactRepository http://download.eclipse.org/releases/galileo
-metadataRepository http://download.eclipse.org/releases/galileo
-profile SDKProfile
-flavor tooling
-destination C:\eclipse
-p2.os win32 -p2.ws win32 -p2.arch x86
The director doesn't do updates currently, but doing both uninstall and install is equivalent. See bug 279659
The install/uninstall value org.eclipse.sdk.ide will depend on what exactly you have installed. Here this is the classic Eclipse SDK. If you are running something else you need to find the root installable unit id. Go to Help -> About -> Installation Details -> Installed Software. Look for the id of the root node of the tree. "Eclipse IDE for C/C++ Developers" is epp.package.cpp. "Eclipse IDE for Java Developers" is epp.package.java.
The -profile value SDKProfile also depends on what package you are running. Check the eclipse.p2.profile property in your config.ini file.
The -destination C:\eclipse is the eclipse I am upgrading which is also the eclipse I'm using to run this command.