NoSuchMethodError when getting display properties using: Display.getDisplayMode

Started by TrieMond, October 17, 2018, 10:24:36

Previous topic - Next topic

TrieMond

I'm trying to get the display properties for my display using: Display.getDisplayMode().getHeight(); and Display.getDisplayMode().getWidth(); but I get the following error:

[LWJGL] Version: 3.2.0 build 12
[LWJGL] 	 OS: Windows 7 v6.1
[LWJGL] 	JRE: 1.8.0_151 amd64
[LWJGL] 	JVM: Java HotSpot(TM) 64-Bit Server VM v25.151-b12 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL] 	Using SharedLibraryLoader...
[LWJGL] 	Found at: C:\Users\user\AppData\Local\Temp\lwjgluser\3.2.0-build-12\lwjgl.dll
[LWJGL] 	Loaded from org.lwjgl.librarypath: C:\Users\user\AppData\Local\Temp\lwjgluser\3.2.0-build-12\lwjgl.dll
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] MemoryUtil allocator: DebugAllocator
[LWJGL] Loading library: glfw
[LWJGL] 	Using SharedLibraryLoader...
[LWJGL] 	Found at: C:\Users\user\AppData\Local\Temp\lwjgluser\3.2.0-build-12\glfw.dll
[LWJGL] 	Loaded from org.lwjgl.librarypath: C:\Users\user\AppData\Local\Temp\lwjgluser\3.2.0-build-12\glfw.dll
[LWJGL] Loading library (system): lwjgl_opengl
[LWJGL] 	Using SharedLibraryLoader...
[LWJGL] 	Found at: C:\Users\user\AppData\Local\Temp\lwjgluser\3.2.0-build-12\lwjgl_opengl.dll
[LWJGL] 	Loaded from org.lwjgl.librarypath: C:\Users\user\AppData\Local\Temp\lwjgluser\3.2.0-build-12\lwjgl_opengl.dll
[LWJGL] Loading library: opengl32
[LWJGL] 	opengl32.dll not found in org.lwjgl.librarypath=C:\Users\user\AppData\Local\Temp\lwjgluser\3.2.0-build-12
[LWJGL] 	Loaded from system paths: C:\Windows\system32\opengl32.dll
Exception in thread "Thread-0" java.lang.NoSuchMethodError: org.lwjgl.glfw.GLFW.glfwInit()I
	at org.lwjglx.Sys.<clinit>(Sys.java:17)
	at org.lwjglx.opengl.Display.<clinit>(Display.java:74)
	at Engine.DisplayRenderEngine.DisplayManager.getWidth(DisplayManager.java:255)
	at Engine.EntityHandeling.BasicEntityRenderer.prepare(BasicEntityRenderer.java:40)
	at Engine.DisplayRenderEngine.DisplayManager.updateDisplay(DisplayManager.java:167)
	at Engine.Core.RenderThread.render(RenderThread.java:167)
	at Engine.Core.RenderThread.run(RenderThread.java:104)


Why do I get this error? How can I fix this?

KaiHH

Okay... Now, you've left out A LOT of context to actually make any sense of the question, the stacktrace and the error.
First off, you are apparently using the LWJGLX LWJGL2/3 compatibility layer, originally developed by the GitHub user kappaOne from 2014. Now, this project does not exist anymore. The only remains of it can be found at: https://github.com/grum/lwjglx
Like I said, this is from 2014, so veeeeery very old and not even close to being compatible with the current GLFW version. So, basically, you cannot use it anymore with any remotely recent version of LWJGL 3. You either have to revert to LWJGL 2.x or just use LWJGL 3 with GLFW directly in your code.

EDIT: SO thread here: https://stackoverflow.com/questions/52853317/nosuchmethoderror-when-getting-display-properties-using-display-getdisplaymode