For users who are experiencing issues with the built-in GLFW, there's a quick and easy solution for you to use the latest, bug-free GLFW that can remedy the solution.
If you are comfortable using tools such as cmake, follow the guide below (more detailed instructions found at https://www.glfw.org/docs/latest/compile.html):
- Clone the glfw repository from github:
https://github.com/glfw/glfw.git - Run
cmake -S . -B build -DBUILD_SHARED_LIBS=ONto ensure the correct makefiles are created - Run
cmake --build buildto compile the source code. - Go to
./build/src/and copylibglfw.so(on Linux) orglfw3.dll(on Windows) somewhere that you can remember (and not delete) - Add the following argument to your java args (the place where you put -Xmx -Xms):
-Dorg.lwjgl.glfw.libname=/path/to/glfw/file, where /path/to/glfw/file should be replaced with the full path to the file you copied above. Examples of this areC:\Users\Me\Documents\glfw3.dll(Windows) or/home/user/Documents/libglfw.so(Linux).