简体   繁体   English

无法添加lwjgl本机

[英]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. 我正在尝试设置Slick2D,但由于未正确添加本机,所以无法运行我的程序。 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. 我已经找到了它们的位置,在我的Slick2D库中添加了lwjgl.jar并在VM参数中添加了它们,但是由于某些原因,它仍然无法正常工作。 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 我也在用Eclipse

Maybe my configuration description will help you. 也许我的配置说明会为您提供帮助。 I put my libs into a "lib" folder near "src". 我将库文件放到“ src”附近的“ lib”文件夹中。 Then I've put all the natives into special folder inside "lib". 然后,我将所有本地人放入“ 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. 我改用了旧版本的lwjgl(2.9.3),现在似乎可以使用了。 Maybe slick doesn't work with the newer version since its no longer being developed? 由于不再开发新版本,slick可能不适用于新版本吗? I'm not 100% sure but that is what worked for me. 我不确定100%,但这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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