简体   繁体   中英

Trouble adding lwjgl natives

I'm trying to set up Slick2D but I can't run my program because of the natives is not being added correctly. I have the location of them added the the lwjgl.jar in my Slick2D library and have them in the VM arguments but for some reason it still doesn't work. I've tried looking around but I can't seem to find anything with a similar problem. Here is the exact error for anyone wondering:

Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
    at Main.main(Main.java:17)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    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)
    ... 1 more

Also I am using Eclipse

Maybe my configuration description will help you. I put my libs into a "lib" folder near "src". Then I've put all the natives into special folder inside "lib". In build path I've configured natives path like this: 在此处输入图片说明

I managed to figure it out. I switched to using a older version of lwjgl (2.9.3) and it seems to work now. Maybe slick doesn't work with the newer version since its no longer being developed? I'm not 100% sure but that is what worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM