0

I am testing the Gluon Mobile framework, and have made a small application based on the Afterburner with FXML template from the IntelliJ Idea Gluon plugin.

The application builds and runs successfully on the JVM and I am also able to build a native image (./gradlew nativeBuild on Linux with GRAALVM_HOME pointing to 20.3.0.r11-grl).

When I try to run the native image (with ./gradlew nativeRun) it fails with javafx.fxml.LoadException: biz/nellemann/pwgen/views/main.fxml. Maybe related to java.lang.ClassNotFoundException: javafx.scene.control.Slider?

I have looked through the Gluon docs and searched for similar errors, but have not been able to solve my problem. I hope someone can take a look and enlighten me.

The full trace can be seen at https://pastebin.pl/view/f75a0138, and the source for my test project is available at https://bitbucket.org/mnellemann/pwgen-gluon/.

Thanks in advance, Mark

  • Just add `javafx.scene.control.Slider` to the `reflectionList`. See https://docs.gluonhq.com/#_reflectionlist. Most of the JavaFX core classes are already added to the list, but some are still missing. – José Pereda Dec 29 '20 at 13:54
  • Thank you @JoséPereda. Probably stupid question, but where is this file located and what syntax should I use? By looking at the documentation you linked to (thanks), it points to a file under *target/* - I'm thinking the file should be somewhere under *src/* ? – Mark Nellemann Dec 29 '20 at 16:17
  • If you are using gradle, the file is under `build/client/...`. It is generated on every build, taking into account your reflection list array. – José Pereda Dec 29 '20 at 16:22
  • I switched to Maven, and native-image works, after I added *javax.scene.controlSlider* to the reflection list in pom.xml. I tried the similar trick in build.gradle first, but I ran into other errors and gave up. – Mark Nellemann Dec 30 '20 at 20:07

0 Answers0