将 jars 添加到 Eclipse 插件 [英] Adding jars to a Eclipse PlugIn

查看:29
本文介绍了将 jars 添加到 Eclipse 插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试构建一个 Eclipse 插件,该插件必须使用依赖于其他 jar 的自写 jar,但我不知道从哪里开始将 jar 作为单独的插件处理.我必须在任何地方使用 .jar 文件还是我错了?

I try to build a Eclipse plugin that has to use a self written jar which is dependent on other jars, but I don't get the point where to start with handling jars as seperate PlugIns. Anywhere I have to use just the .jar files or am I wrong?

推荐答案

我想我找到了合适的解决方案;诀窍是您必须通过 Eclipse 实现所有文件.我只是将发布到 news.eclipse.platform 的解决方案复制到这里:

I think I found a proper solution; the trick is that you have to implement all the files via Eclipse. I just copy here the solution which was posted to news.eclipse.platform:

在插件中包含 jars:

Include the jars in a plugin:

  1. 使用 Import > File System 将 jar 文件导入到您的插件项目中,比如在 /lib 目录中.
  2. 使用 Add... 按钮将 jar 添加到 plugin.xml > Runtime 选项卡的类路径部分.
  3. 使用 New... 按钮添加."图书馆回来(当然没有引号).
  4. 确保您的二进制构建在 plugin.xml > Build 选项卡上导出新的 jar 文件.
  5. 保存
  6. 在项目上,使用 context menu > PDE Tools > Update Classpath 将 jars 正确添加到 eclipse 项目类路径.莉>
  1. Use Import > File System to import the jar files into your plugin project, say in the <project>/lib directory.
  2. Use Add... button to add the jars to the classpath section of the plugin.xml > Runtime tab.
  3. Use New... button to add "." library back (with no quotes, of course).
  4. Make sure your binary build exports the new jar files on the plugin.xml > Build tab.
  5. Save
  6. On the project, use context menu > PDE Tools > Update Classpath to correctly add the jars to the eclipse project classpath.

这篇关于将 jars 添加到 Eclipse 插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆