如何在 OSGI 中的捆绑包中导入 Javafx8

How to Import Javafx8 in a bundle in OSGI

我正在使用 Felix 开发 OSGI 应用程序。现在我想在一个包中使用一些 JavaFx8 类 但我有以下错误:

Unable to resolve 1.0: missing requirement [1.0] osgi.wiring.package; (osgi.wiring.package=javafx.geometry

如何在我的包中导入 JavaFx8 SDK 包。

提前致谢,

您可以将库添加到 felix 类路径并将必要的包附加到 org.osgi.framework.system.packages.extra 选项。 http://felix.apache.org/site/apache-felix-framework-configuration-properties.html 如果你这样做,捆绑包没有。 0 将导出所需的包。稍后我可以在我的电脑上提供更详细的说明,现在我在移动设备上。

I'm working on an OSGI application with Felix. Now I want to use some JavaFx8 classes in a bundle

I need to create a complete GUI and I'll need an important number of imports.

我已经发布了 Drombler FX 的一些抢先体验版本,这是一个基于 OSGi (Apache Felix) 和 Maven 的新的 JavaFX 富客户端平台。

作为一个应用程序框架,它确保 JavaFX 和 OSGi 能够正常启动,并提供主要的 window。

您可以在此处阅读有关 Drombler FX 的更多信息:http://puces-blog.blogspot.ch/search/label/Drombler

有一个 Getting Started 页面解释了如何通过几个简单的步骤创建、构建和 运行 Drombler FX 示例应用程序。

经过多次研究,我终于通过在项目的pom.xml中添加我需要的包来解决问题:

<configuration><provision>
        <param>--platform=felix</param>
        <param>--noConsole</param>
        <param>--systemPackages=javafx.animation,javafx.application,javafx.collections,javafx.embed.swing,javafx.geometry,javafx.scene,javafx.scene.layout,javafx.scene.transform,javax.swing,javax.swing.border,org.osgi.framework</param>
      </provision></configuration>

或者通过将以下属性添加到同一文件(项目的 pom):

<properties>
<org.osgi.framework.system.packages.extra>javafx.animation,javafx.application,javafx.collections,javafx.embed.swing,javafx.geometry,javafx.scene,javafx.scene.layout,javafx.scene.transform,javax.swing,javax.swing.border,org.osgi.framework
</org.osgi.framework.system.packages.extra>
<org.osgi.service.http.port>8080</org.osgi.service.http.port>
<org.osgi.service.http.port.secure>8443</org.osgi.service.http.port.secure>

对于 More information 检查 link。