Search for JavaFX and include in classpath

Help
Luis K
2013-07-09
2014-04-16
  • Luis K
    Luis K
    2013-07-09

    Hi,
    Launch4J is really awesome!
    I know that with JavaFX you can generate a launcher with an ant task, but I was willing to keep using Launch4J.
    My app uses Swing and I'm starting to include some JavaFX components, but the problem is that I must include the jfxrt.jar to the classpath but it could be in many different places.
    Starting with Java 7u6, the JavaFX is installed with the JRE.
    It would be really nice if Launch4J could also look for JavaFX and include the required libraries to the classpath.
    Regards,
    Luis Fernando

     
  • Olive
    Olive
    2014-04-15

    Hi,

    I have the same question.
    I cannot figure out how to include jfxrt.jar in the classpath.

    The only dirty workaround is to add:

    <!-- JRE (>1.7.0_06) -->
    <cp>%JAVA_HOME%\lib\jfxrt.jar</cp>
    <!-- JDK (>1.7.0_06) -->
    <cp>%JAVA_HOME%\jre\lib\jfxrt.jar</cp>
    

    However, this relies on the facts that:

    • the system has JAVA_HOME environment variable, and
    • JAVA_HOME points to the same JRE/JDK location as the one detected by Launch4j

    This is too unreliable.

    Is there a variable to know the JRE location that Launch4j uses at runtime?

    Thanks!

     
  • Olive
    Olive
    2014-04-15

    It seems that Feature Request #61 would answer my requirement...

     
  • Grzegorz Kowal
    Grzegorz Kowal
    2014-04-15

    Hi,

    I changed the priority of that feature request, planned for next release.

    Grzegorz

     
  • Olive
    Olive
    2014-04-16

    Thanks Grzegorz!

    I tried the patch from feature request #61 and can confirm that it works.

    Waiting for next release!