Opening .jar file on mac using JDK 11 fails with RuntimeException





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















I am trying to open a .jar file (https://github.com/ptrckbnck/SQLChecker/releases) on my MAC Mojave 10.14 , I need it for my university course.



What I did:




  • installed java OpenJDK 11 as suggested here https://solarianprogrammer.com/2018/09/28/installing-openjdk-macos/


java -version



openjdk version "11.0.1" 2018-10-16  
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)


But when I run java -jar SQLChecker-1.0.jar I keep on getting the following exception:



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:222)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)
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)
... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)


I have read related thread Migration to JDK 11 + JavaFX 11 giving RuntimeException and downloaded also JavaFX 11, namely JavaFX Mac OS X SDK from here https://gluonhq.com/products/javafx/. I also run the following code:



export PATH_TO_FX=my/path/to/javafx-sdk-11/lib


and run HelloWorld test using JavaFX 11 as described here https://openjfx.io/openjfx-docs/. Everything worked fine but did not solve my original problem.
As was suggested by @Drimux in the related thread some libraries are missing in the OpenJDK distribution. He sad that those probably are libprism_es2.dylib, libprism_sw.dylib, libglass.dylib, libjavafx_font.dylib. So I copied those files from the javafx-sdk-11.0.1/lib into /Library/Java/JavaVirtualMachine/jdk-11.0.1.jdk/Contents/Home/lib and tried to run my .jar file again. Got new exception:



GLFactory.static - Platform: Mac OS X - not available: com.sun.prism.es2.MacGLFactory
java.lang.ClassNotFoundException: com.sun.prism.es2.MacGLFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.sun.prism.es2.GLFactory$FactoryLoader.run(GLFactory.java:108)
at com.sun.prism.es2.GLFactory$FactoryLoader.run(GLFactory.java:100)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.prism.es2.GLFactory.<clinit>(GLFactory.java:97)
at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:76)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:834)
java.lang.ClassNotFoundException: com.sun.glass.ui.mac.MacPlatformFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:42)
at com.sun.glass.ui.Application.run(Application.java:144)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)
Failed to load Glass factory class
Exception in thread "main" java.lang.NullPointerException
at com.sun.glass.ui.Application.run(Application.java:144)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)


This didn't fix the problem. If you need more information please request.
What else should I try?










share|improve this question































    2















    I am trying to open a .jar file (https://github.com/ptrckbnck/SQLChecker/releases) on my MAC Mojave 10.14 , I need it for my university course.



    What I did:




    • installed java OpenJDK 11 as suggested here https://solarianprogrammer.com/2018/09/28/installing-openjdk-macos/


    java -version



    openjdk version "11.0.1" 2018-10-16  
    OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
    OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)


    But when I run java -jar SQLChecker-1.0.jar I keep on getting the following exception:



    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:222)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.base/java.lang.Thread.run(Thread.java:834)
    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)
    ... 1 more
    Exception in thread "main" java.lang.RuntimeException: No toolkit found
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.base/java.lang.Thread.run(Thread.java:834)


    I have read related thread Migration to JDK 11 + JavaFX 11 giving RuntimeException and downloaded also JavaFX 11, namely JavaFX Mac OS X SDK from here https://gluonhq.com/products/javafx/. I also run the following code:



    export PATH_TO_FX=my/path/to/javafx-sdk-11/lib


    and run HelloWorld test using JavaFX 11 as described here https://openjfx.io/openjfx-docs/. Everything worked fine but did not solve my original problem.
    As was suggested by @Drimux in the related thread some libraries are missing in the OpenJDK distribution. He sad that those probably are libprism_es2.dylib, libprism_sw.dylib, libglass.dylib, libjavafx_font.dylib. So I copied those files from the javafx-sdk-11.0.1/lib into /Library/Java/JavaVirtualMachine/jdk-11.0.1.jdk/Contents/Home/lib and tried to run my .jar file again. Got new exception:



    GLFactory.static - Platform: Mac OS X - not available: com.sun.prism.es2.MacGLFactory
    java.lang.ClassNotFoundException: com.sun.prism.es2.MacGLFactory
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at com.sun.prism.es2.GLFactory$FactoryLoader.run(GLFactory.java:108)
    at com.sun.prism.es2.GLFactory$FactoryLoader.run(GLFactory.java:100)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at com.sun.prism.es2.GLFactory.<clinit>(GLFactory.java:97)
    at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:76)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
    at java.base/java.lang.Thread.run(Thread.java:834)
    java.lang.ClassNotFoundException: com.sun.glass.ui.mac.MacPlatformFactory
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:42)
    at com.sun.glass.ui.Application.run(Application.java:144)
    at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.base/java.lang.Thread.run(Thread.java:834)
    Failed to load Glass factory class
    Exception in thread "main" java.lang.NullPointerException
    at com.sun.glass.ui.Application.run(Application.java:144)
    at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.base/java.lang.Thread.run(Thread.java:834)


    This didn't fix the problem. If you need more information please request.
    What else should I try?










    share|improve this question



























      2












      2








      2








      I am trying to open a .jar file (https://github.com/ptrckbnck/SQLChecker/releases) on my MAC Mojave 10.14 , I need it for my university course.



      What I did:




      • installed java OpenJDK 11 as suggested here https://solarianprogrammer.com/2018/09/28/installing-openjdk-macos/


      java -version



      openjdk version "11.0.1" 2018-10-16  
      OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
      OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)


      But when I run java -jar SQLChecker-1.0.jar I keep on getting the following exception:



      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:222)
      at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
      at java.base/java.lang.Thread.run(Thread.java:834)
      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)
      ... 1 more
      Exception in thread "main" java.lang.RuntimeException: No toolkit found
      at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
      at java.base/java.lang.Thread.run(Thread.java:834)


      I have read related thread Migration to JDK 11 + JavaFX 11 giving RuntimeException and downloaded also JavaFX 11, namely JavaFX Mac OS X SDK from here https://gluonhq.com/products/javafx/. I also run the following code:



      export PATH_TO_FX=my/path/to/javafx-sdk-11/lib


      and run HelloWorld test using JavaFX 11 as described here https://openjfx.io/openjfx-docs/. Everything worked fine but did not solve my original problem.
      As was suggested by @Drimux in the related thread some libraries are missing in the OpenJDK distribution. He sad that those probably are libprism_es2.dylib, libprism_sw.dylib, libglass.dylib, libjavafx_font.dylib. So I copied those files from the javafx-sdk-11.0.1/lib into /Library/Java/JavaVirtualMachine/jdk-11.0.1.jdk/Contents/Home/lib and tried to run my .jar file again. Got new exception:



      GLFactory.static - Platform: Mac OS X - not available: com.sun.prism.es2.MacGLFactory
      java.lang.ClassNotFoundException: com.sun.prism.es2.MacGLFactory
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:315)
      at com.sun.prism.es2.GLFactory$FactoryLoader.run(GLFactory.java:108)
      at com.sun.prism.es2.GLFactory$FactoryLoader.run(GLFactory.java:100)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at com.sun.prism.es2.GLFactory.<clinit>(GLFactory.java:97)
      at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:76)
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:315)
      at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
      at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
      at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
      at java.base/java.lang.Thread.run(Thread.java:834)
      java.lang.ClassNotFoundException: com.sun.glass.ui.mac.MacPlatformFactory
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:315)
      at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:42)
      at com.sun.glass.ui.Application.run(Application.java:144)
      at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
      at java.base/java.lang.Thread.run(Thread.java:834)
      Failed to load Glass factory class
      Exception in thread "main" java.lang.NullPointerException
      at com.sun.glass.ui.Application.run(Application.java:144)
      at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
      at java.base/java.lang.Thread.run(Thread.java:834)


      This didn't fix the problem. If you need more information please request.
      What else should I try?










      share|improve this question
















      I am trying to open a .jar file (https://github.com/ptrckbnck/SQLChecker/releases) on my MAC Mojave 10.14 , I need it for my university course.



      What I did:




      • installed java OpenJDK 11 as suggested here https://solarianprogrammer.com/2018/09/28/installing-openjdk-macos/


      java -version



      openjdk version "11.0.1" 2018-10-16  
      OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
      OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)


      But when I run java -jar SQLChecker-1.0.jar I keep on getting the following exception:



      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:222)
      at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
      at java.base/java.lang.Thread.run(Thread.java:834)
      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)
      ... 1 more
      Exception in thread "main" java.lang.RuntimeException: No toolkit found
      at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
      at java.base/java.lang.Thread.run(Thread.java:834)


      I have read related thread Migration to JDK 11 + JavaFX 11 giving RuntimeException and downloaded also JavaFX 11, namely JavaFX Mac OS X SDK from here https://gluonhq.com/products/javafx/. I also run the following code:



      export PATH_TO_FX=my/path/to/javafx-sdk-11/lib


      and run HelloWorld test using JavaFX 11 as described here https://openjfx.io/openjfx-docs/. Everything worked fine but did not solve my original problem.
      As was suggested by @Drimux in the related thread some libraries are missing in the OpenJDK distribution. He sad that those probably are libprism_es2.dylib, libprism_sw.dylib, libglass.dylib, libjavafx_font.dylib. So I copied those files from the javafx-sdk-11.0.1/lib into /Library/Java/JavaVirtualMachine/jdk-11.0.1.jdk/Contents/Home/lib and tried to run my .jar file again. Got new exception:



      GLFactory.static - Platform: Mac OS X - not available: com.sun.prism.es2.MacGLFactory
      java.lang.ClassNotFoundException: com.sun.prism.es2.MacGLFactory
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:315)
      at com.sun.prism.es2.GLFactory$FactoryLoader.run(GLFactory.java:108)
      at com.sun.prism.es2.GLFactory$FactoryLoader.run(GLFactory.java:100)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at com.sun.prism.es2.GLFactory.<clinit>(GLFactory.java:97)
      at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:76)
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:315)
      at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
      at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
      at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
      at java.base/java.lang.Thread.run(Thread.java:834)
      java.lang.ClassNotFoundException: com.sun.glass.ui.mac.MacPlatformFactory
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      at java.base/java.lang.Class.forName0(Native Method)
      at java.base/java.lang.Class.forName(Class.java:315)
      at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:42)
      at com.sun.glass.ui.Application.run(Application.java:144)
      at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
      at java.base/java.lang.Thread.run(Thread.java:834)
      Failed to load Glass factory class
      Exception in thread "main" java.lang.NullPointerException
      at com.sun.glass.ui.Application.run(Application.java:144)
      at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
      at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
      at java.base/java.lang.Thread.run(Thread.java:834)


      This didn't fix the problem. If you need more information please request.
      What else should I try?







      java macos jar java-11 javafx-11






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 5:29









      Naman

      46k12102206




      46k12102206










      asked Nov 16 '18 at 23:04









      ElMingElMing

      304




      304
























          1 Answer
          1






          active

          oldest

          votes


















          2














          If you have downloaded the jar from the first test release, when running it like:



          java -jar SQLChecker-1.0.jar


          you will get the posted exception.



          As a first easy fix, if you have downloaded JavaFX 11 SDK, run this instead:



          java --module-path /path-to/javafx-sdk-11/lib --add-modules javafx.controls,javafx.fxml -jar SQLChecker-1.0.jar


          You can read about why you need those VM arguments here.



          In any case, you shouldn't copy the native files from the JavaFX SDK to the JDK.



          New releases



          But there are two more new releases of SQLChecker.



          If you try the last one:



          java -jar SQLChecker-1.0.3.jar


          that will work fine, without adding those extra arguments.



          So what has changed?



          They are distributing a fat Jar with the Maven shade plugin, and in order to work on JavaFX 11 on any platform, you need to include not only the jars, but also the native libraries.



          As you can see, in this commit, by including the classifier tag for javafx.graphics, they added the required native libraries for Windows, Linux and Mac, as it has been also stated in this question.



          If you want to know more about how to create a fat jar, see this doc.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53346518%2fopening-jar-file-on-mac-using-jdk-11-fails-with-runtimeexception%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            If you have downloaded the jar from the first test release, when running it like:



            java -jar SQLChecker-1.0.jar


            you will get the posted exception.



            As a first easy fix, if you have downloaded JavaFX 11 SDK, run this instead:



            java --module-path /path-to/javafx-sdk-11/lib --add-modules javafx.controls,javafx.fxml -jar SQLChecker-1.0.jar


            You can read about why you need those VM arguments here.



            In any case, you shouldn't copy the native files from the JavaFX SDK to the JDK.



            New releases



            But there are two more new releases of SQLChecker.



            If you try the last one:



            java -jar SQLChecker-1.0.3.jar


            that will work fine, without adding those extra arguments.



            So what has changed?



            They are distributing a fat Jar with the Maven shade plugin, and in order to work on JavaFX 11 on any platform, you need to include not only the jars, but also the native libraries.



            As you can see, in this commit, by including the classifier tag for javafx.graphics, they added the required native libraries for Windows, Linux and Mac, as it has been also stated in this question.



            If you want to know more about how to create a fat jar, see this doc.






            share|improve this answer




























              2














              If you have downloaded the jar from the first test release, when running it like:



              java -jar SQLChecker-1.0.jar


              you will get the posted exception.



              As a first easy fix, if you have downloaded JavaFX 11 SDK, run this instead:



              java --module-path /path-to/javafx-sdk-11/lib --add-modules javafx.controls,javafx.fxml -jar SQLChecker-1.0.jar


              You can read about why you need those VM arguments here.



              In any case, you shouldn't copy the native files from the JavaFX SDK to the JDK.



              New releases



              But there are two more new releases of SQLChecker.



              If you try the last one:



              java -jar SQLChecker-1.0.3.jar


              that will work fine, without adding those extra arguments.



              So what has changed?



              They are distributing a fat Jar with the Maven shade plugin, and in order to work on JavaFX 11 on any platform, you need to include not only the jars, but also the native libraries.



              As you can see, in this commit, by including the classifier tag for javafx.graphics, they added the required native libraries for Windows, Linux and Mac, as it has been also stated in this question.



              If you want to know more about how to create a fat jar, see this doc.






              share|improve this answer


























                2












                2








                2







                If you have downloaded the jar from the first test release, when running it like:



                java -jar SQLChecker-1.0.jar


                you will get the posted exception.



                As a first easy fix, if you have downloaded JavaFX 11 SDK, run this instead:



                java --module-path /path-to/javafx-sdk-11/lib --add-modules javafx.controls,javafx.fxml -jar SQLChecker-1.0.jar


                You can read about why you need those VM arguments here.



                In any case, you shouldn't copy the native files from the JavaFX SDK to the JDK.



                New releases



                But there are two more new releases of SQLChecker.



                If you try the last one:



                java -jar SQLChecker-1.0.3.jar


                that will work fine, without adding those extra arguments.



                So what has changed?



                They are distributing a fat Jar with the Maven shade plugin, and in order to work on JavaFX 11 on any platform, you need to include not only the jars, but also the native libraries.



                As you can see, in this commit, by including the classifier tag for javafx.graphics, they added the required native libraries for Windows, Linux and Mac, as it has been also stated in this question.



                If you want to know more about how to create a fat jar, see this doc.






                share|improve this answer













                If you have downloaded the jar from the first test release, when running it like:



                java -jar SQLChecker-1.0.jar


                you will get the posted exception.



                As a first easy fix, if you have downloaded JavaFX 11 SDK, run this instead:



                java --module-path /path-to/javafx-sdk-11/lib --add-modules javafx.controls,javafx.fxml -jar SQLChecker-1.0.jar


                You can read about why you need those VM arguments here.



                In any case, you shouldn't copy the native files from the JavaFX SDK to the JDK.



                New releases



                But there are two more new releases of SQLChecker.



                If you try the last one:



                java -jar SQLChecker-1.0.3.jar


                that will work fine, without adding those extra arguments.



                So what has changed?



                They are distributing a fat Jar with the Maven shade plugin, and in order to work on JavaFX 11 on any platform, you need to include not only the jars, but also the native libraries.



                As you can see, in this commit, by including the classifier tag for javafx.graphics, they added the required native libraries for Windows, Linux and Mac, as it has been also stated in this question.



                If you want to know more about how to create a fat jar, see this doc.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 17 '18 at 13:15









                José PeredaJosé Pereda

                27.4k34675




                27.4k34675
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53346518%2fopening-jar-file-on-mac-using-jdk-11-fails-with-runtimeexception%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Bressuire

                    Vorschmack

                    Quarantine