Forum Stats

  • 3,876,077 Users
  • 2,267,057 Discussions
  • 7,912,420 Comments

Discussions

Unable to run simple JavaFX on Linux

Veerendra S-Oracle
Veerendra S-Oracle Member Posts: 3
edited Jun 3, 2016 2:27PM in JavaFX 2.0 and Later

Hi,

    I am trying to run a simple JavaFX program on my Linux machine and it fails with a library issue. I packed the jar as a normal jar with manifest file.

    The command I use is /ade_autofs/gd29_3rdparty/nfsdo_generic/JDK7/MAIN/LINUX.X64/160404.1.7.0.101.0B014/jdk7/bin/java -cp .:/ade_autofs/gd29_3rdparty/nfsdo_generic/JDK7/MAIN/LINUX.X64/160404.1.7.0.101.0B014/jdk7/jre/lib/jfxrt.jar application.Main2

    Here is the exception trace:

--

Prism ES2 Error - nInitialize: glXChooseFBConfig failed

Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /ade_autofs/gd29_3rdparty/nfsdo_generic/JDK7/MAIN/LINUX.X64/160404.1.7.0.101.0B014/jdk7/jre/lib/amd64/libglass.so: libgio-2.0.so.0: cannot open shared object file: No such file or directory

        at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:284)

        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:127)

        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163)

        at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)

        at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)

        at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.UnsatisfiedLinkError: /ade_autofs/gd29_3rdparty/nfsdo_generic/JDK7/MAIN/LINUX.X64/160404.1.7.0.101.0B014/jdk7/jre/lib/amd64/libglass.so: libgio-2.0.so.0: cannot open shared object file: No such file or directory

        at java.lang.ClassLoader$NativeLibrary.load(Native Method)

        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1968)

        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1893)

        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)

        at java.lang.Runtime.load0(Runtime.java:795)

        at java.lang.System.load(System.java:1062)

        at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:200)

        at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:88)

        at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31)

        at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:74)

        at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:81)

        at com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:28)

        at com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:25)

        at java.security.AccessController.doPrivileged(Native Method)

        at com.sun.glass.ui.gtk.GtkPlatformFactory.<clinit>(GtkPlatformFactory.java:25)

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:195)

        at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:20)

        at com.sun.glass.ui.Application.Run(Application.java:104)

        at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:274)

        ... 5 more

--

With regards,

Veerendra S.

Answers

  • jsmith
    jsmith Member Posts: 2,856
    edited Jun 3, 2016 12:39PM

    Java 7 is end of life for public updates:

      https://java.com/en/download/faq/java_7.xml

    I suggest you try again with a more modern Java version:

    Java SE Development Kit 8 - Downloads

    Also note, for executing Java 8 programs, it is not necessary to explicitly add jfxrt.jar to the Java runtime classpath.

    You should verify that your Linux version is a supported configuration (unsupported Linux versions may work, or they may not):

    Oracle JDK 8 and JRE 8 Certified System Configurations

    Note the text on the certified configurations page:

    • For Linux platforms, gtk2 2.18+ is required for supporting JavaFX.
    Veerendra S-Oracle
  • Veerendra S-Oracle
    Veerendra S-Oracle Member Posts: 3
    edited Jun 3, 2016 12:46PM

        Thanks Smith for the quick reply.

         I now ran with JDK1.8 and I get different error now. Could this be becoz my Linux version (Linux 2.6.39-400.215.10.el5uek #1 SMP Tue Sep 9 22:51:46 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux)

    --

    [[email protected] tools]$ /ade_autofs/gd29_3rdparty/nfsdo_generic/JDK8/MAIN/LINUX.X64/160401.1.8.0.91.0B14/jdk8/bin/java application.Main2

    Graphics Device initialization failed for :  es2, sw

    Error initializing QuantumRenderer: no suitable pipeline found

    java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found

            at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)

            at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:221)

            at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:205)

            at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)

            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)

            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: Error initializing QuantumRenderer: no suitable pipeline found

            at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)

            at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)

            at java.lang.Thread.run(Thread.java:745)

    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: No toolkit found

            at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:217)

            at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)

            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

    --

  • jsmith
    jsmith Member Posts: 2,856
    edited Jun 3, 2016 2:27PM

    There is a trouble-shooting procedure for that stack trace, which is defined on StackOverflow:

    http://stackoverflow.com/questions/21185156/javafx-on-linux-is-showing-a-graphics-device-initialization-failed-for-es2-s

    Try following it.

    > Could this be becoz my Linux version ...

    I don't know.  You are only supplying the kernel version (as far as I can tell - I'm not a Linux expert). 

    You are not supplying enough information for somebody to assist in determining that info.

    For instance, you don't report the distribution version (e.g. Ubuntu 15.10 or Redhat enterprise Linux 7.2).

    You also don't report the version of gtk that you have installed.

This discussion has been closed.