Skip to content

javafx – Graphics Device initialization failed for : es2, sw M1 MacOS

So, when I try to run my JavaFX Code sample on my M1 MBA I get this long error. https://pastebin.com/3EBekwVF

I am using macOS aarch64 javafx sdk from https://gluonhq.com/products/javafx/

I added the SDK to the Java Build Path via right clicking on the project -> selecting Java Build Path -> switching to Library tab -> add all .jars and src.zip with “Add External Jars” Then I went into my run configurations and added this line to my vm arguments

--module-path /Users/lockna/eclipse-workspace/javafx-sdk-18/lib --add-modules javafx.controls,javafx.fxml

I tried some fixes I found on reddit or other stack overflow posts, but they didn’t work for me.

Any other fix I could try or something I could do?

Answer

Fixed it with setting the used JRE to the latest openjdk installed with brew. Then I had to uncheck the Use the -XstartOnFirstThread argument when launching with SWT box in Run configurations in the VM tab, then it worked