Mendicant Bias
Mendicant Bias

Reputation: 108

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

Whenever I try to run a Java program using LWJGL, I end up with this error or some permutation of it:

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)

I have tried entering -Djava.library.path="/Users/marcus888/Downloads/Giraffemacka/natives/" when running from commandline, but it still doesn't work. Help?

By the way, this doesn't have anything to do with the code of the program in question; this error happens for even full Java games like Minecraft.

Upvotes: 3

Views: 7772

Answers (3)

ydobonebi
ydobonebi

Reputation: 240

For lack of mentioning which platform you are on and I realize this is an old post but I just had the same issue and resolved it so I wanted to add. I'm using windows, I had to copy and paste the filepath that the DLL files were actually in and that fixed it. It had to be exact including the drive letter for me to get it to work. so in my case it was (not under my main user path) "e:\LWJGL\lwjgl-2.9.3\natives\windows" (excluding the quotes unless you have spaces). Now it works fine.

Upvotes: 0

user2507255
user2507255

Reputation:

To fix the java.lang.UnsatisfiedLinkError in LWJGL:
use this piece of code:
System.setProperty("org.lwjgl.librarypath", "\lib_folder");
replace "\lib_folder" with your natives/library's folder

Upvotes: 3

JohnnyO
JohnnyO

Reputation: 3068

I don't believe your path should be quoted there. Try using:

-Djava.library.path=/Users/marcus888/Downloads/Giraffemacka/natives/

Upvotes: 0

Related Questions