eclipse 库包 - 无法从某些库导出包
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检查以下内容:
配置->订单与出口
地区,并且正在检查出口。
导出到清单中(PDE 工具
->打开清单 ->运行时选项卡)
确保 JAR 文件位于
显式类路径。
如下),确保构建
属性已标记您的罐子
排除(尽管这不太可能
当你遇到错误时你的问题
编译)。
如果所有这些都已完成(并且仍然无法正常工作),请执行干净的构建并重新启动 Eclipse。有时 Eclipse 对此感到有点困惑,重新启动会有所帮助。
Check the following:
Configuration -> Order and Export
area, and they are check for export.
exported in the manifest (PDE Tools
-> Open Manifest -> Runtime tab)
sure the JAR files are in the
manifest classpath.
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.
检查 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.
如果这一切仍然没有帮助:清单编辑器的概述页面上有一个链接项“更新类路径设置”。点击这个无辜的小东西终于帮我完成了任务
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