如何使用命令行自动安装 Eclipse 插件?

发布于 2024-12-01 04:00:56 字数 266 浏览 2 评论 0原文

我需要自动安装 Eclipse Classic 并添加两个“插件”:

  • CDT (不确定这是否可以称为“插件”)
  • PyDev

安装 Eclipse Classic (刚刚下载):

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

如何安装 CDT 和 PyDev 作为系统插件(不是用户的) )?

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)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

南风起 2024-12-08 04:00:56

我可以找到这两个有帮助的文档:

安装新下载的 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 -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

要安装 PyDev,我们首先需要插入其自动签名证书(可以在此处找到: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"

因此运行它:

sudo ./add_pydev_certificate.py

所需的 PyDev 功能是:

  • PyDev for Eclipse( 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 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

这是一个较晚的答案,但您可能需要检查将存储库的功能和插件目录复制到位于主 Eclipse 文件夹下的名为 dropins 的文件夹中。这在 Helios 及更高版本中有效。更多信息请访问此链接

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.

只是我以为 2024-12-08 04:00:56

您可以从 GUI 手动将 CDT 和 PyDev 添加到当前的 Eclipse 安装中。
然后将它们全部打包到一个存档中并保存到一个存档中。在目标系统上解压。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文