bell-sw / Liberica

Free and 100% open source Progressive Java Runtime for modern Java™ deployments supported by a leading OpenJDK contributor
https://bell-sw.com/pages/libericajdk/
GNU General Public License v2.0
299 stars 28 forks source link

Unable to start JavaFX application on an arm-32 device #175

Open FirokOtaku opened 1 month ago

FirokOtaku commented 1 month ago

Recently I'm testing JavaFX on an arm-32 device with Liberica JDK.

Full demo project code is here. It's a project contains basical code to test JavaFX/JavaFX WebView/JNA functionalities.

After compiling project by mvn javafx:jlink -Djavafx.platform=linux and trying to lauch that compiled jar by ./target/app/bin/app, I got this error message:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1135)
Caused by: java.lang.UnsupportedOperationException: Minimum GTK version required is 3.8.0. System has 2.24.32.
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._initGTK(Native Method)
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:180)
        at javafx.graphics/com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:40)
        at javafx.graphics/com.sun.glass.ui.Application.run(Application.java:146)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:290)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:292)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 2 more

Then I tried figure out what version of GTK was installed with OS:

> dpkg -l | grep gtk

ii  gir1.2-gtk-3.0:armhf                       3.24.5-1                                armhf        GTK+ graphical user interface library -- gir bindings
ii  gtk-update-icon-cache                      3.24.5-1                                armhf        icon theme caching utility
ii  libcanberra-gtk3-0:armhf                   0.30-7                                  armhf        GTK+ 3.0 helper for playing widget event sounds with libcanberra
ii  libcheese-gtk25:armhf                      3.31.90-1                               armhf        tool to take pictures and videos from your webcam - widgets
ii  libclutter-gtk-1.0-0:armhf                 1.8.4-4                                 armhf        Open GL based interactive canvas library GTK+ widget
ii  libdbusmenu-gtk3-4:armhf                   18.10.20180917~bzr490+repack1-1         armhf        library for passing menus over DBus - GTK-3+ version
ii  libfm-gtk-data                             1.3.1-1                                 all          file management support (GTK+ library common data)
ii  libfm-gtk4:armhf                           1.3.1-1                                 armhf        file management support (GTK+ 2.0 GUI library)
ii  libgtk-3-0:armhf                           3.24.5-1                                armhf        GTK+ graphical user interface library
ii  libgtk-3-common                            3.24.5-1                                all          common files for the GTK+ graphical user interface library
ii  libgtk2.0-0:armhf                          2.24.32-3                               armhf        GTK+ graphical user interface library
ii  libgtk2.0-common                           2.24.32-3                               all          common files for the GTK+ graphical user interface library
ii  libgtkmm-3.0-1v5:armhf                     3.24.0-2                                armhf        C++ wrappers for GTK+ (shared libraries)
ii  libgtksourceview-3.0-1:armhf               3.24.9-2                                armhf        shared libraries for the GTK+ syntax highlighting widget
ii  libgtksourceview-3.0-common                3.24.9-2                                all          common files for the GTK+ syntax highlighting widget
ii  lightdm-gtk-greeter                        2.0.6-1                                 armhf        simple display manager (GTK+ greeter)
ii  lxhotkey-gtk                               0.1.0-1+b1                              armhf        LXHotkey keyboard shortcuts configurator (GTK+ GUI plugin)
ii  python-gtk2                                2.24.0-5.1+b1                           armhf        Python bindings for the GTK+ widget set
ii  wicd-gtk                                   1.7.4+tb2-6                             all          wired and wireless network manager - GTK+ client
ii  xdg-user-dirs-gtk                          0.10-3                                  armhf        tool to manage well known user directories (Gtk extension)

It seems both GTK 2 and GTK 3 are installed and that may be the cause of the problem. But I don't know what should I do next to fix that problem.

Environment version
System Debian 10 (buster)
JDK Liberica JDK 21.0.3-full