NoClassDefFoundError

Started by darkness24713, November 01, 2016, 02:22:37

Previous topic - Next topic

darkness24713

Hello,

I am new to the forums here. Last night I tried setting up LWJGL into Eclipse but was having some issues getting it to work. I used the example HelloWorld to test if I got it setup but it keeps throwing me the following error

Quote[LWJGL] Version: 3.1.0 build 40
[LWJGL]     OS: Windows 10 v10.0
[LWJGL]    JRE: 1.8.0_91 amd64
[LWJGL]    JVM: Java HotSpot(TM) 64-Bit Server VM v25.91-b15 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL] [TLS] Failed to initialize unsafe implementation.
[LWJGL] ThreadLocalUtil state: TLState
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.system.MemoryAccess
   at org.lwjgl.system.Pointer.<clinit>(Pointer.java:22)
   at org.lwjgl.system.Platform.mapLibraryNameBundled(Platform.java:76)
   at org.lwjgl.glfw.GLFW.<clinit>(GLFW.java:563)
   at test.HelloWorld.run(HelloWorld.java:28)
   at test.HelloWorld.main(HelloWorld.java:104)

If anyone could assist me, I would be grateful.

Thank You.

darkness24713

i have gotten a little further now. but now I'm getting a different error. i get the window to show up but it isn't painted red.

QuoteHello LWJGL 3.1.0 build 40!
[LWJGL] Version: 3.1.0 build 40
[LWJGL]     OS: Windows 10 v10.0
[LWJGL]    JRE: 1.8.0_91 amd64
[LWJGL]    JVM: Java HotSpot(TM) 64-Bit Server VM v25.91-b15 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL]    Found at: C:\Users\Ponkable\AppData\Local\Temp\lwjglPonkable\3.1.0-build-40\lwjgl.dll
[LWJGL]    Loaded from org.lwjgl.librarypath: C:\Users\Ponkable\AppData\Local\Temp\lwjglPonkable\3.1.0-build-40\lwjgl.dll
[LWJGL] ThreadLocalUtil state: UnsafeState
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
java.lang.ClassNotFoundException: org.lwjgl.system.jemalloc.JEmallocAllocator
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at org.lwjgl.system.MemoryManage.getInstance(MemoryManage.java:36)
   at org.lwjgl.system.MemoryUtil$LazyInit.<clinit>(MemoryUtil.java:76)
   at org.lwjgl.system.MemoryUtil.getAllocator(MemoryUtil.java:138)
   at org.lwjgl.system.Callback.<clinit>(Callback.java:67)
   at test.HelloWorld.init(HelloWorld.java:36)
   at test.HelloWorld.run(HelloWorld.java:20)
   at test.HelloWorld.main(HelloWorld.java:104)
[LWJGL] Failed to instantiate memory allocator: org.lwjgl.system.jemalloc.JEmallocAllocator
[LWJGL] MemoryUtil allocator: StdlibAllocator
[LWJGL] Loading library: glfw
[LWJGL]    Found at: C:\Users\Ponkable\AppData\Local\Temp\lwjglPonkable\3.1.0-build-40\glfw.dll
[LWJGL]    Loaded from org.lwjgl.librarypath: C:\Users\Ponkable\AppData\Local\Temp\lwjglPonkable\3.1.0-build-40\glfw.dll
[LWJGL] Loading library: opengl32
[LWJGL]    opengl32.dll not found in org.lwjgl.librarypath=C:\Users\Ponkable\AppData\Local\Temp\lwjglPonkable\3.1.0-build-40
[LWJGL]    Loaded from java.library.path: C:\WINDOWS\system32\opengl32.dll

spasi

The exception related to JEmallocAllocator is not a critical error, it's there for debugging purposes. It happens if you don't include the lwjgl-jemalloc module in your application (and don't change the default allocator in org.lwjgl.system.Configuration). As you can see immediately after the exception, LWJGL falls back to the StdlibAllocator.

Afaict from the above, GLFW and OpenGL should be working fine. Post a code sample if you'd like.