每当我尝试使用 LWJGL 运行 Java 程序时,我都会遇到这个错误或它的一些排列:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860) at java.lang.Runtime.loadLibrary0(Runtime.java:845) at java.lang.System.loadLibrary(System.java:1084) 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.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:37) at java.security.AccessController.doPrivileged(Native Method) at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:34) at com.mojang.mojam.giraffe.Game.main(Game.java:220)
从命令行运行时,我尝试输入 -Djava.library.path="/Users/marcus888/Downloads/Giraffemacka/natives/" ,但它仍然不起作用。帮助?
顺便说一句,这与相关程序的代码没有任何关系;即使是完整的 Java 游戏(如 Minecraft)也会发生此错误。