We're very pleased that you want to get in touch with us. Please fill in the form below:

or   Close this form  
Some content

Peter Pilgrim :: Java Champion :: Digital Developer Architect

I design Java EE and Scala software solutions for the blue-chip clients and private sector

Hey all! Thanks for visiting. I provide fringe benefits to interested readers: checkout consultancy, training or mentorship Please make enquiries by email or call +44 (0)7397 067 658.

Due to the Off-Payroll Working plan for the UK government, unfortunately, I am no longer accepting standard GOV.UK contract engagements for the public sector. Please enquire for further information.

Install JavaFX Runtime Into Local Maven Repository

17 October 2011 9 comments

2 minutes


In order to get JavaFX 2.0 to work with a Maven Repository, requires some fudge factor. Because one cannot simply redistribute JavaFX Library, you have to install the libraries manually into a local Maven repository.

This is my MSDOS command script to do it:

REM Installing Oracle JavaFX 2.0 Runtime into a Local Maven Repository
REM Based on the information from JFXtras 2.0 Project
REM http://code.google.com/p/jfxtras/wiki/ContributorGettingStarted
REM Peter Pilgrim 12th September 2011 in Crete

REM set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_27
REM set javafx.home=C:\Program Files\Oracle\JavaFX 2.0 SDK
REM set JAVAFX_HOME=C:\Program Files\Oracle\JavaFX 2.0 SDK
REM set javafx.home=%JAVAFX_HOME%
REM set USERPROFILE=C:\Users\Peter

REM Install the JavaFX Java Library
call mvn install:install-file -Dfile="%javafx.home%\rt\lib\jfxrt.jar" -DgroupId=com.oracle -DartifactId=javafx-runtime -Dversion=2.0 -Dpackaging=jar

pushd "%javafx.home%\rt\bin"
del /f /q %USERPROFILE%\Documents\javafx-dll-temp-bin.jar
"%JAVA_HOME%\bin\jar" -cf  %USERPROFILE%\Documents\javafx-dll-temp-bin.jar *.dll

REM Install Native libraries
call mvn install:install-file -Dfile=%USERPROFILE%\Documents\javafx-dll-temp-bin.jar -DgroupId=com.oracle -DartifactId=javafx-runtime -Dversion=2.0 -Dpackaging=jar -Dclassifier=windows

REM Copy the binaries to the Maven Local Repository
copy "%javafx.home%\rt\bin"  %USERPROFILE%\.m2\repository\com\oracle\javafx-runtime\bin

REM End.

Once you have the local repository set up, once include a Maven dependency into a project like this:


Thus the group is com.oracle, the artifact id javafx-runtime, and the version is 2.0.

There you go.

  • Tom Eugelink

    Please note that the JFXtras project also uses Maven as the build tool and has a method (Application.prelaunch) to unpack the binaries directly from the jar at runtime, so can be loaded by JavaFX.

  • Youguiyo

    Thanks for sharing your batch file.
    The last line is not environment independent.

    call copy “%javafx.home%rtbin” C:UsersPeter.m2repositorycomoraclejavafx-runtimebin

    should be

    call copy “%javafx.home%rtbin” %USERPROFILE%.m2repositorycomoraclejavafx-runtimebin

  • Thanks for spotting the typo …

  • Absolutely. JFXtras extended Application abstract class does have that feature. If you use JFXtras 2.0 in your application then take advantage of that until Oracle makes the JavaFX available in the Maven repository (one day in the future)

  • Timothy Sparg

    I found that copy in this line copy “%javafx.home%rtbin” %USERPROFILE%.m2repositorycomoraclejavafx-runtimebin needed to be replaced with *xcopy*

  • Peter Pilgrim

    Absolutely. Thanks

  • Peter Pilgrim

    Absolutely. Thanks

  • K Gomez

    I followed these steps but I cannot make it work.

    I’ve got jfxrt.jat in my classpath and I can import JavaFx classes, but when I run the project, I get java.lang.NoClassDefFoundError exceptions for every class.

    I’m using Netbeans 7.1 Beta, Maven 3.0.3 and JavaFx 2.0 of course.


  • Peter Pilgrim

    Looks like you have a particular NetBeans IDE configuration issue and make sure that jfxrt.jar in the correct folder %USERPROFILE%.m2repositorycomoraclejavafx-runtime2.0

    It might also to help search the OTN JavaFX 2.0 specifies forums https://forums.oracle.com/forums/forum.jspa?forumID=1385&start=0


Contents of this blog entry are under copyright © 2017 by Peter Pilgrim and associates. For enquiries after republishing, please contact us for permission. All requests for syndicated content will be ignored /dev/null, consider yourself warned!

I help to design, create and build JVM components and services that are behind popular e-commerce websites.

My Blurb

Please get in touch , directly, to establish hire availability, contract & consulting opportunities.

Speaking at Your Conference

Contact by invitation

What Peter Does