How to embed JavaFX into eclipse rcp view


I am trying to use JavaFX 2 from a simple eclipse view, but I am getting an

java.lang.UnsatisfiedLinkError: Invalid URL for class: bundleresource://435.fwk1827795025/com/sun/glass/utils/NativeLibLoader.class

After some investigation with JAD I have found out that NativeLibLoader has very interesting check:

if(!classUrlString.startsWith("jar:file:") || classUrlString.indexOf("!") == -1)
    throw new UnsatisfiedLinkError((new StringBuilder()).append("Invalid URL for class: ").append(classUrlString).toString());

Does this mean that javafx can't be used from OSGi bundle? Please prove me wrong.

2/20/2012 9:49:03 PM

Accepted Answer

Updates to the JavaFX loader to be more friendly with OSGI are scheduled for the "Lombard" release (which is the JavaFX 3.0 timeframe, i.e. 2013). Until then, you may encounter issues working with JavaFX from an OSGI bundle. Other OSGI related issues can be found by searching for OSGI in the JavaFX Jira (anybody can signup to view the bugs and issues listed there). Tom Schindl, the creator of the e(fx)clipse plugin for JavaFX in Eclipse, would be the best contact point with experience in integrating JavaFX within Eclipse.

2/21/2012 10:30:11 PM

I've just released a step by step tutorial how to create and export an Eclipse ViewPart that uses JavaFX 2.0. See

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow