Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.UnsatisfiedLinkError: com.sun.glass.ui.gtk.GtkApplication._isDisplayValid()Z in JavaFx

Tags:

ubuntu

javafx

I have a machine with Ubuntu 16.10 (yakkety) and it runs a javafx application perfectly. but I'm getting this exception when I try to run the same application in another machine with Ubuntu 18.10 (cosmic) even though I have the same openjfx package (8u102-b14-1). Other openjfx bionic packages don't work either.

Run command:

java -jar target/app.jar

Output:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: com.sun.glass.ui.gtk.GtkApplication._isDisplayValid()Z
    at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:267)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    ... 5 more
Caused by: java.lang.UnsatisfiedLinkError: com.sun.glass.ui.gtk.GtkApplication._isDisplayValid()Z
    at com.sun.glass.ui.gtk.GtkApplication._isDisplayValid(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.isDisplayValid(GtkApplication.java:83)
    at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:67)
    at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
    at com.sun.glass.ui.Application.run(Application.java:146)
    at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:257)
    ... 9 more

Does anybody know how to solve this?

like image 348
Rafael Avatar asked Dec 12 '18 14:12

Rafael


1 Answers

In Ubuntu 18 I downgrade openfx, libopenjfx-java, libopenjfx-jni:

sudo apt-get install libopenjfx-java=8u161-b12-1ubuntu2 \
                     libopenjfx-jni=8u161-b12-1ubuntu2 \
                     openjfx=8u161-b12-1ubuntu2
like image 67
NELSON RODRIGUEZ Avatar answered Oct 19 '22 14:10

NELSON RODRIGUEZ