Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX on MacOS ARM: Graphics Device initialization failed

I am using JavaFX on a MacBook M1 inside the Intellij IDE. My application builds and runs as expected within Intellij, but when I build the application into an executable jar and run it from the terminal I receive the error:

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:832)
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:832)

I have found possible solutions about graphic driver issues, but the fact that the application ran just fine within the IDE makes me believe that wouldn't be the issue (also none of the solutions were for the M1 MacBooks). If any other information is needed please let me know! Thank you in advance!

like image 240
Legomanalec Avatar asked Oct 15 '22 22:10

Legomanalec


1 Answers

Try Liberica OpenJDK , works on MacBook Pro 2020 M1. I had the same issue, after installing the full version which has LibericaFX, the issue resolved.

  • Full version of Liberica includes LibericaFX, which is based on OpenJFX and Minimal VM, where suitable.
  • Standard version is best suited for server and desktop deployments that do not require any additional components.
  • Lite version of Liberica works best for cloud deployments and is optimized for size.

also available on HomeBrew

brew tap bell-sw/liberica
brew install liberica-jdk16-full
like image 181
Zayne Liu Avatar answered Oct 17 '22 14:10

Zayne Liu