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.

This entry was posted in e(fx)clipse. Bookmark the permalink.

16 Responses to JavaFX 2 and OSGi-Deployment models

  1. Pingback: Java desktop links of the week, March 12 | Jonathan Giles

  2. Pingback: JavaFX links of the week, March 12 // JavaFX News, Demos and Insight // FX Experience

  3. Markus says:

    Hi Tom, I got an 403 for
    Maybe you could fix that!?


  4. Not Relevant says:

    403: Access forbidden! when trying to retrieve

  5. Not Relevant says:

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

    • Tom Schindl says:

      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?

  6. Rad says:

    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 says:

      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.

  7. Pingback: e(fx)clipse 0.0.13 released | Tomsondev Blog

  8. vitu says:

    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(

  9. William says:

    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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.