So starting with JDK-11 OpenJFX is not part of any downloadable distribution. As JavaFX is designed to run on the module-path (and tested only there) you have 2 options to run JavaFX inside OSGi:
* You create your own JDK-Distribution using jlink
* You launch the VM you want to use JavaFX adding the JavaFX-Modules
While the 2nd solution is doable for RCP-Applications it is less than a nice one, and for integrating into external frameworks (like the Eclipse IDE) it is not possible at all. So we need a different solution to satisfy both usecases.
The solution to this problem is that e(fx)clipse installs a classloader hook using the Equinox AdapterHook-Framework (you can do crazy stuff with that) and on the fly spins up a new Java-Module-Layer containing all the JavaFX-Modules and uses the classloader from the Module-Layer to load the JavaFX-Classes.
With this strategy you can supply the JavaFX-Modules (including the native bits) required for your application to run as part of your p2-repository.
Awesome!
Pingback: JavaFX links of the week, August 6 | JavaFX News, Demos and Insight // FX Experience
I hope this is the last annoying change you need to tackle Tom, but with Oracle you never know…
Will this approach also work with Maven based projects?
Thanks!
I see no reason. Updateing the maven-sample using Java11 is on my list.
Great! I never could made the current version with with Java 9… so I can’t wait. Thank you!
Hi! Is there a tutorial somewhere that explains how to build an RCP application that has OpenJFX views, and to be able to run this RCP application for instance with a basic JRE from OpenJDK 11 ?