Slick: lwjgl in java.library.path

I know this is an extremely common problem, but I’ve followed all the instructions I can find for setting up Slick, which consists of this:

  1. Create a new project
  2. Add lwjgl.jar and slick.jar to build path (I also added slick-util.jar)
  3. Add the natives under lwjgl.jar in the build path

Here’s a screenshot http://imgur.com/umOlH showing that I have indeed done all this, and you can see the error I’m still getting for some reason below it. Have I done anything wrong or forgotten anything?

No you didn’t follow all the instructions, nasty boy !

Go to your run/debug configurations, and include this in your jvm Arguments :

-Djava.library.path=c:\path\to\your\lwjgl\natives

If the path he used in the “natives” property is the path to the .dll’s or .so’s, then it’s right.
What Eclipse does is: It collects all paths given in all given libraries, and for each path it gets, it adds it to the jvm arguments with -Djava.library.path="all/the;paths/to;all/the;natives/and;even/much/more".

Most likely you downloaded an old version of Slick that packages the natives inside of JAR files. You need to extract those and point Eclipse to the actual native files, or a folder containing the native files.

Ideally you should download a more recent version of Slick.

It’s also important to include the natives for the operating system you’re currently working with. In Eclipse IDE you can separately determine the native folder for each jar in the library path.