0

I have created a new GraalVM + JavaFX project with simple interface, but instead of this:

I can see only this:

I have compiled my project with/on:

  • Solus OS (Linux) with kernel 6.1.5
  • Java 17 provided by GraalVM SDK (below)
  • GraalVM v22.1.0.1 redistributed by Gluon
  • Using GluonFX Maven Plugin v1.0.16

You can easily reproduce it:

  1. Clone my GitHub repo with all project related code
  2. Download GraalVM release for your host system
  3. Install (unpack) it anywhere and change path to SDK in pom.xml (graalvm.home property)
  4. Just run mvn clean install to run metadata collecting agent, build native image and run it
SoKnight
  • 33
  • 7
  • What do you see in the logs for `mvn gluonfx:nativerun` ? – José Pereda Feb 12 '23 at 08:41
  • @JoséPereda yes, i did. I can loss something important, what I should to find there? – SoKnight Feb 12 '23 at 09:48
  • If there are no exceptions there, try running with `-Dprism.verbose=true` . – José Pereda Feb 12 '23 at 09:58
  • 1
    This looks like a resource loading problem to me. The css and the font seem to be missing somehow. That's what I would check first. – mipa Feb 12 '23 at 10:13
  • @JoséPereda Prism logging is looking fine, no exceptions or `error` tagged messages. @mipa I check that, but there are no CSS resource used, only inline styles. Font is loaded correctly because there are no any errors like NPE or another resource loading exception. I also tried to use default font (without any custom), but there are no button text displayed anyway. Any suggestions? – SoKnight Feb 12 '23 at 12:35
  • Your project runs fine for me on macOS. Maybe you can try to catch some possible hidden exception, adding `try { ... } catch (Throwable t) { t.printStackTrace(); }` to the content of your `start()` method. – José Pereda Feb 12 '23 at 12:48
  • @JoséPereda thank you for testing of this code on MacOS, but the problem still unresolved for Linux hosts :( All this time I have test native compilation of this project using Liberica Native Image Kit (Java 17) and it works fine in case when the binary is already opened and I trying to run second app process using same binary file. Video example: https://youtu.be/gCOBO3Lfgvc Seems that problem cause is video driver OR desktop environment OR windows manager (X11) – SoKnight Feb 12 '23 at 14:14
  • Can you check with `ldd` if the native binary is missing any package or library? – José Pereda Feb 12 '23 at 15:07
  • One other thing you can try is enabling sw rendering in the plugin’s configuration and set `-Dprism.order=sw`, then build and test. – José Pereda Feb 12 '23 at 18:32
  • `-Dprism.order=sw` solved a similar issue in Linux for me (rendering ok but no text at all shown) in a program I am working on, so thanks! Also, unlike the software renderer, the default one tends to slow down when loading a lot of images, so I suspect there is one bug or two lurking around... – Marco Righele Apr 26 '23 at 23:33

1 Answers1

1

During all that day I have tested native AOT compilation of this test project.
Binaries is working fine on Windows and Mac OS hosts, but not at all Linux hosts, and it's so sad :(

I will use the next 'partially native' app distribution solution:

  • Linux: app-image (jlink) + launch4j.
  • Mac OS: native-image using Liberica NIK.
  • Windows: native-image using Liberica NIK.

Thanks a lot to José Pereda for any help and instant answers.

SoKnight
  • 33
  • 7