eclipse 库包 - 无法从某些库导出包

发布于 2024-08-14 00:04:30 字数 321 浏览 2 评论 0原文

我在 eclipse 3.5 中创建了一个简单的插件项目,它只存储第三方库,供 eclipse RCP 应用程序中的其他包使用。按预期工作:我编辑了清单,导出了所需的包并将库添加到构建路径(项目构建路径以及清单构建路径)。

几天后,我向该项目添加了另一个 jar,执行了相同的步骤(导出包,将库添加到构建路径),但这次我无法从其他包中的导出包导入类。该包在清单编辑器上显然是可以选择的,但类中的导入语句只是用红色的卷曲线嘲笑我。从捆绑包导出的其他包中导入类仍然有效,只有新添加的库中的类仍然不可见。

有谁知道我可能错过了什么?我很困惑,不知道如何说服谷歌向我展示这个丑陋问题的解决方案......

I've created a simple plugin project in eclipse 3.5 that just stores third-party libraries for the use by other bundles in an eclipse RCP application. Worked as expected: I edited the manifest, exported the required packages and added the libraries to the build path (project build path as well as manifest build path).

Some days later I added another jar to that project, did the same steps (exporting a package, adding the library to the build path(s)) but this time I can't import classes from that exported package in other bundles. The package was clearly selectable on the manifest editor but import statements in classes just taunt me with curly red lines. Importing classes from other packages exported by the bundles still works, only classes from the newly added lib remain invisible.

Has anyone has an idea what I might have missed? I'm pretty stuck and have no idea how to convince google to show me the solution to that ugly issue...

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

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

发布评论

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

评论(3

土豪我们做朋友吧 2024-08-21 00:04:30

检查以下内容:

  1. 确保它们在构建中
    配置->订单与出口
    地区,并且正在检查出口。
  2. 确保您有包裹
    导出到清单中(PDE 工具
    ->打开清单 ->运行时选项卡)
  3. 在与上面相同的位置,使
    确保 JAR 文件位于
    显式类路径。
  4. (正如艾尔所说
    如下),确保构建
    属性已标记您的罐子
    排除(尽管这不太可能
    当你遇到错误时你的问题
    编译)。

如果所有这些都已完成(并且仍然无法正常工作),请执行干净的构建并重新启动 Eclipse。有时 Eclipse 对此感到有点困惑,重新启动会有所帮助。

Check the following:

  1. Make sure they are in the Build
    Configuration -> Order and Export
    area, and they are check for export.
  2. Make sure you have the packages
    exported in the manifest (PDE Tools
    -> Open Manifest -> Runtime tab)
  3. In the same place as above, make
    sure the JAR files are in the
    manifest classpath.
  4. (as Al says
    below), make sure the build
    properties has your jars marked for
    exclusion (though this is not likely
    your issue as you are getting errors
    compiling).

If all of this is done (and it's still not working), do a clean build an restart eclipse. Sometimes the Eclipse gets a little confused about this and a restart helps.

-残月青衣踏尘吟 2024-08-21 00:04:30

检查 build.properties 以查看 bin.includes 是否包含您新添加的 Jar。如果没有它,构建过程将不会导出它,因此无法在依赖包中使用它。

Check the build.properties to see if the bin.includes includes your newly added Jar. Without it, it won't be exported by the build process, and thus won't be able to use it in dependent bundles.

筱果果 2024-08-21 00:04:30

如果这一切仍然没有帮助:清单编辑器的概述页面上有一个链接项“更新类路径设置”。点击这个无辜的小东西终于帮我完成了任务

if all this still does not help: there is a link item "update the classpath settings" on the Overview page of the manifest editor. Clicking this innocent little thingy finally did the job for me

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