Search code examples
osgijavafx-2apache-felix

Using JavaFX 2.2 in OSGi bundle


How can I use JavaFX 2.2 in a OSGi bundle? I'm using Apache Felix so it's no eclispe project. It must run on Mac OSX with Java7 installed (Java6 would be cool but not necessary).

I've read something about repacking the jfx libraries but for eclispe plugin projects.

Just importing the javafx packages in the bundle Manifest created a missing requirement osgi.wiring.package Exception.


Solution

  • Try using the e(fx)clipse runtime tools, which include libraries to allow JavaFX to work well in an OSGi environment.

    According to the e(fx)clipse site:

    Unfortunately JavaFX is not written with OSGi in mind so there are various places which are causing problems when running inside OSGi ranging from the fact JavaFX-Binaries are located somewhere on the users system, to problems when it comes to class loading because of OSGi's visibility rules. e(fx)clipse provides helper libraries to deal with all those problems and makes writing JavaFX applications ontop of Eclipse Equinox a feel as easy as it is with SWT and Swing