How do you automate the installation of Eclipse pl

2019-01-31 23:25发布

I need to automate Installation of Eclipse Classic and add two "plugins" :

  • CDT (not sure this can be called a "plugin")
  • PyDev

Install Eclipse Classic (just downloaded) :

sudo tar -xvzf eclipse-SDK-3.7-linux-gtk.tar.gz -C /usr/local/

How to install then CDT and PyDev as system plugins (not user's)?

3条回答
啃猪蹄的小仙女
2楼-- · 2019-02-01 00:02

I could find these two docs which helped :

Install freshly downloaded Eclipse Classic :

sudo tar -xvzf eclipse-SDK-3.7-linux-gtk.tar.gz -C /usr/local/

To install desired CDT features (references found by using Eclipse's "Help>Install new software" tool)

  • C/C++ Development Tools ( org.eclipse.cdt.feature.group )
  • C/C++ Development Tools SDK ( org.eclipse.cdt.sdk.feature.group )
  • C/C++ Development Platform ( org.eclipse.cdt.platform.feature.group )
  • C/C++ Memory View Enhancements ( org.eclipse.cdt.debug.ui.memory.feature.group )
  • Eclipse Debugger for C/C++ ( org.eclipse.cdt.debug.edc.feature.group )
  • Miscellaneous C/C++ Utilities ( org.eclipse.cdt.util.feature.group )

run :

sudo /usr/local/eclipse/eclipse -nosplash \
  -application org.eclipse.equinox.p2.director \
  -repository http://download.eclipse.org/releases/indigo/,http://download.eclipse.org/tools/cdt/releases/helios/ \
  -destination /usr/local/eclipse \
  -installIU org.eclipse.cdt.feature.group \
  -installIU org.eclipse.cdt.sdk.feature.group \
  -installIU org.eclipse.cdt.platform.feature.group \
  -installIU org.eclipse.cdt.debug.ui.memory.feature.group \
  -installIU org.eclipse.cdt.debug.edc.feature.group \
  -installIU org.eclipse.cdt.util.feature.group

To install PyDev, we first need to insert their auto-signed certificate (which can be found here : http://pydev.org/pydev_certificate.cer )

#!/usr/bin/env python
# add PyDev's certificate to Java's key and certificate database
# Certificate file can be downloaded here : http://pydev.org/pydev_certificate.cer
import os, sys
import pexpect

print "Adding pydev_certificate.cer to /usr/lib/jvm/java-6-openjdk/jre/lib/security/cacerts"

cwd = os.path.abspath (os.path.dirname(sys.argv[0]))
child = pexpect.spawn("keytool -import -file ./pydev_certificate.cer -keystore /usr/lib/jvm/java-6-openjdk/jre/lib/security/cacerts")
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"

so run it :

sudo ./add_pydev_certificate.py

The desired PyDev features are :

  • PyDev for Eclipse ( org.python.pydev.feature.feature.group )

run :

sudo /usr/local/eclipse/eclipse -nosplash \
  -application org.eclipse.equinox.p2.director \
  -repository http://pydev.org/updates/ \
  -destination /usr/local/eclipse \
  -installIU org.python.pydev.feature.feature.group
查看更多
迷人小祖宗
3楼-- · 2019-02-01 00:02

This is a late answer but you might want to check out copying the feature and plugin directory of your repository to a folder called dropins located under the main eclipse folder. This works as of Helios and later. More information can be found at this link.

查看更多
成全新的幸福
4楼-- · 2019-02-01 00:06

You may add CDT and PyDev manually, from GUI, into your current Eclipse installation. Then pack them altogether into one archive & unpack on target system(s).

查看更多
登录 后发表回答