Search code examples
javamacoslwjglapple-m1

GLFW_PLATFORM_ERROR by using LWJGL


I just set up LWJGL 3 in Eclipse and I wanted to test it with the example code. This is the output that I get:

Hello LWJGL 3.2.3 build 13!
[LWJGL] GLFW_PLATFORM_ERROR error
    Description : Cocoa: Failed to find service port for display
    Stacktrace  :
        org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:830)
        my.lwjgltests.HelloWorld.init(HelloWorld.java:42)
        my.lwjgltests.HelloWorld.run(HelloWorld.java:24)
        my.lwjgltests.HelloWorld.main(HelloWorld.java:114)
[LWJGL] GLFW_PLATFORM_ERROR error
    Description : Cocoa: Failed to find service port for display
    Stacktrace  :
        org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:830)
        my.lwjgltests.HelloWorld.init(HelloWorld.java:42)
        my.lwjgltests.HelloWorld.run(HelloWorld.java:24)
        my.lwjgltests.HelloWorld.main(HelloWorld.java:114)

By the way, I'm on macOS Big Sur with an M1 chip, so maybe it's a problem?

Edit: I have another Mac from 2012 with macOS Catalina, and everything seems to work properly.

Edit 2: Since I have two monitors, I tried with only one and got just one of the two errors above. So maybe I should find a way to "bind" the program to the monitors since it outputs "Failed to find service port for display"?


Solution

  • OK, so apparently the problem was pretty obvious: GLFW is just not available on Apple M1 yet.

    GLFW_PLATFORM_ERROR on the GLFW documentation