LibGDX keeps giving me this error: "ERROR BAD LOGIC GAMES", how do I fix this?
Asked Answered
Q

1

7

trying to get libgdx working on intellJ, but I keep getting this error, with an image that says bad logic games. I have already assign the working directory to the core/assets folder, but I am completely lost on what to do.

11:09:44 AM: Executing task 'DesktopLauncher.main()'...

Task :core:compileJava UP-TO-DATE
Task :core:processResources NO-SOURCE
Task :core:classes UP-TO-DATE
Task :core:jar UP-TO-DATE
Task :desktop:compileJava UP-TO-DATE
Task :desktop:processResources UP-TO-DATE
Task :desktop:classes UP-TO-DATE

Task :desktop:DesktopLauncher.main()
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.lwjgl.LWJGLUtil$3 (file:/C:/Users/SKIKK/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl/2.9.3/3df168ac74e4a8c96562cdff24ad352e255bf89c/lwjgl-2.9.3.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.lwjgl.LWJGLUtil$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Queenie answered 11/3, 2021 at 10:16 Comment(1)
That’s a warning, not an error. Is it crashing?Balkin
M
11

This can happen if your system's Java version is incompatible with LWJGL2. libGDX began adding support for the LWJGL3 backend at least five years ago, but some setup guides and tutorials out there still have you set up a project with LWJGL2--even the official setup tool provided by libGDX creates a project with LWJGL2 as the backend.

Depending on your graphic needs, you may be fine just ignoring the error, and your program should still run on most systems. But it's recommended to switch to LWJGL3, because that is what the developers of libGDX continue to support.

To switch to the LWJGL3 backend, in your core projects dependencies, change:

compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"

to

compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"

A recently created issue on the libGDX issue tracker happens to give a little context on the warning you are seeing and the reasons why, if you're curious about the current state of the warning.

Margenemargent answered 12/3, 2021 at 16:18 Comment(2)
I had the same warnings, changed lwjgl to lwjgl3 as you said, tried to run and got error: Caused by: java.lang.SecurityException: sealing violation: package org.lwjgl is sealed. How can I solve it?Links
Hmm, that has come up before in this instance, you may be able to use the same solution in the next comment there: replace LwjglApplicationConfiguration and LwjglApplication with Lwjgl3ApplicationConfiguration and Lwjgl3Application everywhere in your desktop launcherMargenemargent

© 2022 - 2024 — McMap. All rights reserved.