本文介绍了LWJGL'java.lang.UnsatisfiedLinkError':java.library.path中没有lwjgl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.libr
ary.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
at org.lorana.client.Lorana.<init>(Lorana.java:20)
at org.lorana.client.Lorana.main(Lorana.java:31)
我将所有本机库链接到每个引用的库后,错误仍然存在,并按照说明操作
The error still persists after I've linked all native libraries to every referenced library, and followed the instructions of http://ninjacave.com/lwjglwitheclipse
我还关注了董事会关于lwjgl uneisfiedlinkerrors的其他问题,但无济于事。
I've also followed other questions on the board regarding lwjgl unsatisfiedlinkerrors, but to no avail.
非常感谢帮助,
提前谢谢!
Would very much appreciate the help,Thanks in advance!
推荐答案
LWJGL使用自己的变量作为本地库的路径:
LWJGL uses its own variables for the path to the native libraries:
System.setProperty("org.lwjgl.librarypath", new File("pathToNatives").getAbsolutePath());
如果您保留LWJGL包的文件结构,您可以使用某些东西像这样:
If you kept the file structure from the LWJGL package you can use something like this:
switch(LWJGLUtil.getPlatform())
{
case LWJGLUtil.PLATFORM_WINDOWS:
{
JGLLib = new File("./native/windows/");
}
break;
case LWJGLUtil.PLATFORM_LINUX:
{
JGLLib = new File("./native/linux/");
}
break;
case LWJGLUtil.PLATFORM_MACOSX:
{
JGLLib = new File("./native/macosx/");
}
break;
}
System.setProperty("org.lwjgl.librarypath", JGLLib.getAbsolutePath());
这篇关于LWJGL'java.lang.UnsatisfiedLinkError':java.library.path中没有lwjgl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!