[LWJGL] UnsatisfiedLinkError //solved

Hello Java-Gaming Community,

Please excuse my poor language skills.
I’ve just learned the basics of Java.
I try now to go a little further and maybe to create my first game with a game engine.

I’ve decided to use Slick and lwjgl for my first try.
Unfortunately I have already a problem.

I get this error message in eclipse:


Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\MyName\Desktop\test\lwjgl-2.8.4\native\windows\lwjgl.dll: The specified path is invalid
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(Unknown Source)
	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:75)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
	at org.lwjgl.Sys.loadLibrary(Sys.java:84)
	at org.lwjgl.Sys.<clinit>(Sys.java:101)
	at org.lwjgl.opengl.Display.<clinit>(Display.java:128)
	at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)
	at Game.main(Game.java:41)

Sourcecode i try to Run:


import org.newdawn.slick.Animation;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.SpriteSheet;
import org.newdawn.slick.tiled.TiledMap;
 
public class Game extends BasicGame {
	private float playerX=320;
	private float playerY=240;
	private TiledMap map;	
	private Animation player;
	public Game() {
		super("Simple Test Code");
	}
	public void init(GameContainer container) throws SlickException {
		container.setVSync(true);
		SpriteSheet sheet = new SpriteSheet("data/player.png",32,32);
		map = new TiledMap("data/unbenannt.tmx");		
		player = new Animation();
		player.setAutoUpdate(true);
		for (int frame=0;frame<3;frame++) {
			player.addFrame(sheet.getSprite(frame,0), 150);
		}		
	}
	public void update(GameContainer container, int delta) { 
		if (container.getInput().isKeyDown(Input.KEY_LEFT)) {playerX--;}
		if (container.getInput().isKeyDown(Input.KEY_RIGHT)) {playerX++;}
		if (container.getInput().isKeyDown(Input.KEY_UP)) {playerY--;}
		if (container.getInput().isKeyDown(Input.KEY_DOWN)) {playerY++;}
	}
	public void render(GameContainer container, Graphics g)  {
		map.render(0, 0);
		g.drawAnimation(player, playerX, playerY);
	}
	public static void main(String[] argv) throws SlickException {
		AppGameContainer container = 
			new AppGameContainer(new Game(), 640, 480, false);
		container.start();
	}
}

Configuration: (Image)

Can you help me?
what am I doing wrong?

With best regards
~pl4n3

did you add the native to LWJGL?
nvm, image never loaded.

do you mean the folder?

With best regards
~pl4n3

To what i believe its just cant find the native file lwjgl.dll but that picture has it there, you havnt moved the folder that contains the native library? to somewhere else then your desktop?

I’ve checked.

If the path is wrong, there is another error:


Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

I’m confused.

With best regards
~pl4n3

in your configuration picture, you have Lwjgl I don’t think there is suppose to be any capitals, mine is lwjgl other then that I have no clue.

Is C:\Users\MyName\Desktop\test\lwjgl-2.8.4\native\windows\lwjgl.dll an actual valid path?

Cas :slight_smile:

@princec: yes :slight_smile:

Thank you for your help.
my workspace accidentally was on a shared folder (other computer)
which apparently results that the native can not be found (or something like that.) :o

SOLVED

With best regards
~pl4n3