1 Reply Latest reply on Sep 3, 2018 12:44 AM by Holly DeBaeke

    New to JavaFX: how to can I make jfxrt.jar and jfxswt.jar available in the JRE?


      Hi, I've been developing with Java for a long time but am brand new to JavaFX. I have an Eclipse RCP and am using a new graphics library which is based on JavaFX. Most of the integration has gone smoothly except for the JRE side of things. Right now, we are adding jfxswt.jar and jfxrt.jar to our OSGi plugin directly. Of course, we don't want to (and can't?) ship this way. I've been searching online but haven't found a way to make these two libraries available at runtime and keep getting ClassNotFoundExceptions. I do also need jfxswt.jar available at compile time.

      The only (reasonable?) solution I've found so far is to add them both through a -Xbootclasspath argument. But that doesn't seem like it should be necessary and doesn't solve my compile time issues.

      Can someone please point me in the right direction?

      Much appreciated.




        • 1. Re: New to JavaFX: how to can I make jfxrt.jar and jfxswt.jar available in the JRE?
          Holly DeBaeke

          Hi, Ken,

          You can use JavaFx by 2 means.

          A - Include the jars in the Java Build Path.  I've not been successful with this one, so, let me give you the second means.

          B - Install the JavaFx plug-in for eclipse.  These are my notes as I worked through it.  Let me know if anything doesn't make sense.

          1. With Eclipse open, click Help > Install New Software…
          2. Click the Add… button.
          3. Enter a name, such as JavaFX.
          4. Enter the location as follows:  http://download.eclipse.org/efxclipse/updates-released/1.2.0/site/
          5. Check both options “e(fx)clipse – install” and “e(fx)clipse – single components” as shown.  Accept other defaults.  Click the Next button.
          6. These are the items that will be installed.  Click Next again.
          7. Accept terms and click Finish.

          You’ll be prompted to reboot Eclipse.  The plug-in is now installed and is ready to use.


          Now, to use JavaFx...

          1. Navigate to File > New > Project
          2. In the New Project wizard, select JavaFx > JavaFX Project
          3. Enter a name for the project, ie, JavaFxDemo, etc.  Click Finish.
          4. Go to the project name > src > application.  Click once on application to highlight.  Create classes here (right-mouse click, New > Class)


          Hope this helps,