2

We are migrating a Java 1.8 JavaFX/Webstart application to Java 11 using Openjfx (https://openjfx.io) and OpenWebStart (https://openwebstart.com).

We successfully migrate and run the app to JavaFx-14 (OpenJfx). To run it at the IDE now it is necessary to include the following jvm args:

 --module-path 'path/javafx-sdk-11.0.2/lib' --add-modules javafx.controls,javafx.fxml

We build the App using Maven. It beautifully works on Java 1.8. It signs all jars, create the package and the jnlp file. Maven also creates an "uber jar" with all dependencies included. We migrated the POM including the new deps. We tested it by manually running the App using the uber jar file via command line (using the --module-path parameters).

We included the --module-path argument in .jnlp file:

    <?xml version="1.0" encoding="utf-8"?>
    <jnlp
      spec="1.0+"
      codebase="http://localhost:8080/download/"
      href="myapp.jnlp">
      <information>
        <title>MyApp</title>
        <vendor>Myself</vendor>
        <homepage href="http://localhost:8080"/>
        <description>My App</description>
        <description>Migration test</description>
        <offline-allowed/>
      </information>

      <security>
         <all-permissions/>
      </security>    

      <resources>
        <j2se version="11" 
          initial-heap-size="256m" 
          max-heap-size="2048m" 
          java-vm-args="-Xms256m -Xmx4096m -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=25 --module-path '/Users/chocksmith/Desktop/javafx-sdk-11.0.2/lib' --add-modules javafx.controls,javafx.fxml"/>
        <jar href="myapp-5.0.0.jar"/>
      </resources>
      <application-desc main-class="com.mycompany.myproduct.application.App"/> 
    </jnlp> 

Unfortunately it fails:

Caused by: java.lang.ClassNotFoundException: javafx.application.Application
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:670)

We run out of ideas here. Please advise!

Chocksmith
  • 1,188
  • 2
  • 12
  • 40

2 Answers2

2

OpenWebStart now provides several points about running JavaFX based application in an FAQ: https://github.com/karakun/OpenWebStart/blob/master/documentation/faq/FAQ.adoc

If this does not help please open an issue at https://github.com/karakun/OpenWebStart/issues

Hendrik Ebbers
  • 2,570
  • 19
  • 34
1

FX must be bundled in the JDK on the client side.

We manage to make it work with Zulo Community version 13.29.11

https://www.azul.com/downloads/zulu-community/?architecture=x86-64-bit&package=jdk-fx

Use "OpenWebStart Settings.app" application to configure the right JVM on your system.

Chocksmith
  • 1,188
  • 2
  • 12
  • 40
  • Starting with Java 11 / JavaFX 11 the preferred way to use JavaFX is by adding it as a dependency. See https://openjfx.io/openjfx-docs/ – Hendrik Ebbers Jun 29 '20 at 07:48