Org.lwjgl.system.Library error

I installed LWJGL 3 in Eclipse and gave me this error when I try to run the test code from https://www.lwjgl.org/guide :

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.system.Library
    at org.lwjgl.system.MemoryAccess.<clinit>(MemoryAccess.java:22)
    at org.lwjgl.system.Pointer.<clinit>(Pointer.java:22)
    at org.lwjgl.glfw.GLFW.<clinit>(GLFW.java:594)
    at HelloWorld.run(HelloWorld.java:30)
    at HelloWorld.main(HelloWorld.java:109)

I made sure everything is set up correctly and I just can’t iron out the problem. What's wrong?

+4
source share
1 answer

You are missing the built-in libraries.

As described in this link https://www.lwjgl.org/guide , you need to configure java.library.path to the location of the native library.

I downloaded the library and copied the HelloWorld code in the link above to HelloWorld.java inside the directory where I extracted the library.

,

/HelloWorld.java
/build.txt
/doc
/jar
/native
/src.zip

HelloWorld.java,

( linux : -classpath jar/*:.)

javac -classpath jar/*;. HelloWorld.java

Run

java -classpath jar/*;. -Djava.library.path=native HelloWorld

.

*

https://www.lwjgl.org/download (Download Release.)

eclipse , . :

Right click on native> build path> use as source

, Jar.

lwjgl.jar > > edit > > .

enter image description here

enter image description here

enter image description here

+5

Source: https://habr.com/ru/post/1621664/


All Articles