JavaFX 2 and OSGi-Deployment models

It looks like a lot of people are interested in using JavaFX into one of their Eclipse Views. I infer that from the people visiting my blog from a stackoverflow question.

The problem people face is that in Eclipse JavaFX has to run in an OSGi-Environment and JavaFX is not prepared for that leading to all sorts of problems when one applies the standard strategies (e.g. simply repackaging the javafx.jar as an OSGi-Bundle).

I’m happy to announce that the upcoming e(fx)clipse release 0.0.13 will fix your problems and make it very easy to use JavaFX inside your Eclipse Views.

The important changes that went into 0.0.13 is that different deployment models are going to be supported:

  • System installation: This deployment model requires your users to have JavaFX pre-installed on their system
  • Next to your app installation: This deployment model requires you to place javafx next to your RCP/IDEs launcher – similar to how you can deploy a JRE with your Eclipse Application
  • As a bundle installation: Here you place your javafx.jar into an OSGi-Bundle and the e(fx)clipse runtime will take care of extracting and wireing

If you want to see it in action you can download a self-contained win32/32bit version of a RCP using this link which uses the 3rd deployment strategy.

The sources are checked into the e(fx)clipse git-repo.

Once 0.0.13 is released (which is going to be next weekend) I hope I can come up with a tutorial.

16 thoughts on “JavaFX 2 and OSGi-Deployment models

    • Tom Schindl March 12, 2012 / 8:35 am

      ok fixed the privileges – thanks for reporting

  1. Not Relevant March 12, 2012 / 9:12 am

    I think I have to wait for the next generation of 16-cores GPUs in order to enjoy JavaFX

    • Tom Schindl March 12, 2012 / 9:16 am

      I’m not sure – maybe it is not using the directx or opengl pipeline and so falls back to software rendering? Did you try to execute a simple JavaFX demo and run it with debug output so that you find out which pipeline it uses?

  2. Rad March 16, 2012 / 2:38 pm

    I extracted the source for the example plug-in from your github (at.bestsolution.efxclipse.runtime.examples.rcp) and I got:

    java.lang.IllegalStateException: Could not find a JavaFX 2.0.2 Installation
    at at.bestsolution.efxclipse.runtime.osgi.fxloader.FXClassLoader$MyBundleClassLoader.createClassloader(

    How do I correctly add the javafx.jar to the plugin?


    • Tom Schindl March 16, 2012 / 2:45 pm

      I think you are running in e(fx)clipse 0.0.12 and there the classloader is not prepared for this new deployment model stuff – you should wait until 0.0.13 (due this weekend) and then the application from the git-repo will start working. 0.0.13 will come with a wizard that allows you to repackage an installed javafx-rt as an OSGi-Bundle useable for the new deployment mode.

  3. vitu July 28, 2012 / 11:30 am

    Dont work on Linux

    java 7, javafx 2.2, e(fx) lastest

    java.lang.IllegalStateException: Could not find a JavaFX installation. Run with -Defxclipse.osgi.hook.debug=true to get debug output. Check your osg/arch ‘linux/x86_64’ in case you want to use repackaging.
    at at.bestsolution.efxclipse.runtime.osgi.fxloader.FXClassLoader$MyBundleClassLoader.createClassloader(
    at at.bestsolution.efxclipse.runtime.osgi.fxloader.FXClassLoader$MyBundleClassLoader.(
    at at.bestsolution.efxclipse.runtime.osgi.fxloader.FXClassLoader.createClassLoader(

    • Tom Schindl July 28, 2012 / 2:17 pm

      Linux 7jdk does not ship with javafx! You need to download the fx-SDK and repackage it!

      • vitu July 28, 2012 / 9:50 pm

        Thanks for answer. I have javafx sdk, and its works in simple eclipse projects.

        What do you mean by “repackage sdk”?

      • Tom Schindl July 29, 2012 / 5:51 am

        Please join our google-forum where we provide support.


  4. William April 24, 2013 / 7:48 pm

    Hi Tom.

    Nowadays, We have a project with JDK 1.7_17 and JavaFX 2.2.7 with different features and plugins. One plugin has javafx and one dependency with at.bestsolution.efxclipse.runtime.javafx and this works fine.
    My problem is when i tried to compile my product with tycho and maven, because always got an error of compilation failure due to javafx.
    These errors are for example that not found the import javafx.embed.swt.FXCanvas, import javafx.scene.Scene, so on. Can you help me? I want to know as i should configure my main pom.xmml to find the jar javafx.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s