我需要自动化Eclipse Classic的安装并添加两个“插件”:
安装Eclipse Classic(仅下载):
sudo tar -xvzf eclipse-SDK-3.7-linux-gtk.tar.gz -C /usr/local/
然后如何安装CDT和PyDev作为系统插件(而不是用户的插件)?
安装新下载的Eclipse Classic:
要安装所需的CDT功能(使用Eclipse的“帮助>安装新软件”工具找到的引用)
跑 :
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
#!/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"
所以运行它:
sudo ./add_pydev_certificate.py
所需的PyDev功能是:
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