如何使用命令行自动安装Eclipse插件? [英] How do you automate the installation of Eclipse plugins with command line?
问题描述
- CDT(不确定这可以称为插件)
- PyDev
安装Eclipse Classic(刚下载):
sudo tar -xvzf eclipse-SDK-3.7-linux-gtk.tar.gz -C / usr / local /
如何安装CDT和PyDev作为系统插件(而不是用户)?
我可以找到这两个帮助的文档:
- http://help.eclipse.org/ indigo / index.jsp?topic =%2Forg.eclipse.platform.doc.user%2Ftasks%2Frunning_eclipse.htm
- http://help.eclipse.org/helios/index.jsp ?话题= / org.eclipse.platform.doc.isv / guide / p2_director.html
安装新下载的Eclipse Classic:
sudo tar -xvzf eclipse-SDK-3.7-linux-gtk.tar.gz -C / usr / local /
安装所需的CDT功能(使用Eclipse的帮助>安装新软件工具) >
- C / C ++开发工具(org.eclipse.cdt.feature.group)
- C / C ++开发工具SDK(org.eclipse.cdt.sdk.feature.group)
- C / C ++开发平台(org.eclipse.cdt.platform.feature.group)
- C / C ++内存查看增强功能(org.eclipse.cdt.debug.ui.memory.feature.group)
- C / C ++的Eclipse调试器(org.eclipse。 cdt.debug.edc.feature.group)
- 其他C / C ++实用程序(org.eclipse.cdt.util.feature.group)
运行:
sudo / usr / local / eclipse / eclipse -nos plash \
-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。 cclipse组\
-installIU org.eclipse.cdt.debug.edc.feature.group \
-installIU org.eclipse.cdt.util.feature.group
要安装PyDev,我们首先需要插入自动签名的证书(可以在这里找到: http://pydev.org/pydev_certificate.cer )
#/ usr / bin / env python
#将PyDev的证书添加到Java的密钥和证书数据库
#证书文件e可以在这里下载:http://pydev.org/pydev_certificate.cer
import os,sys
import pexpect
print将pydev_certificate.cer添加到/ 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 输入密钥库密码:)
child.sendline(changeit)
如果child.expect([信任此证书?,已存在])== 0:
child.sendline(yes)
try:
child.interact()
除了OSError:
pass
打印done
所以运行它:
sudo ./add_pydev_certificate.py
所需的PyDev功能是:
- Eclipse的PyDev(org.python.pydev.feature.feature.group)
运行:
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
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)?
I could find these two docs which helped :
- http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Frunning_eclipse.htm
- http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html
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
这篇关于如何使用命令行自动安装Eclipse插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!