【发布时间】:2022-12-18 07:04:41
【问题描述】:
在我完成初始项目设置并运行后,它向我抛出此错误
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:1046)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.initializeGlfw(Lwjgl3Application.java:88)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:138)
at com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:13)
Caused by: java.lang.IllegalStateException: GLFW may only be used on the main thread and that thread must be the first thread in the process. Please run the JVM with -XstartOnFirstThread. This check may be disabled with Configuration.GLFW_CHECK_THREAD0.
at org.lwjgl.glfw.EventLoop.<clinit>(EventLoop.java:30)
... 4 more
我尝试在运行任务下将 jvm 参数添加到我的 build.gradle 文件中,如 here 所述,但它一直向我抛出相同的错误。
我不知道这是否是 m1 mac 问题,但它适用于我的 Windows 用户朋友。
【问题讨论】:
-
当您将
-XstartOnFirstThread添加到您的Info.plist时会发生什么?
标签: java visual-studio-code gradle libgdx