Mac M1 Error GLFW Main Thread

When using IntelliJ IDEA,

  1. open Edit Run Configuration dialog

Right Click → More Run/Debug → Modify Run Configurations…

  1. Add vm options
  • Modify options → Add VM Options → Add VM options
  • add -XstartOnFirstThread to VM Options, but NOT Program arguments.
  • store as project file, so you don’t need to change configuraions every time.

  1. Update JDK

If you do everything above but still can’t run your app, make sure you don’t use any Swing/AWT thing in your code.
If it’s still not working, update jdk to 11+. It is the AWTLoader in DesktopAssetManager stopped the main thread. Update JDK will fix it.