Slick, Phys2D, LWJGL, and Eclipse

This guide will be as straight-to-the-point as can be. Please note, I make an example of the Linux version in this setup, but you can substitute the instructions for Windows or Mac if that is what you use.


Create an Eclipse project that uses Slick, Phys2D and LWJGL.


  1. Slick – website – Download the “full distribution” (~ 9.8 MB)
  2. LWJGL – website – I prefer to use the “last stable build” from the project repository (currently 2.2.0, ~ 3.6 MB)
  3. Phys2D – website – Download the latest build (current build 2008-04-06, ~ 100 KB)


This is a personal preference, but I rename the Phys2D download. It downloads as phys2d-060408.jar, so I rename it phys2d.jar.

Next, extract/unzip the file, it doesn’t matter where. We will import the files into the Eclipse workspace later anyway.

Open up Eclipse and start a new project.

File >> New >> Java Project

Presumably, you know your way around Eclipse so I will not help with the specifics of creating a project.

Now that the project is created, create a new folder called lib in the project.

File >> New >> Folder
Click the project name
Folder name: lib

Next, we import Slick and Phys2D into the project.

Right click lib >> Left click Import >> General >> File System >> Next
Browse to the unzipped slick directory and find the slick/lib folder >> OK
Select the following jar files
  • jogg-0.0.7.jar
  • jorbis-0.0.15.jar
  • lwjgl.jar
  • slick.jar
Click Finish

You’ve imported Slick, now we import Phys2D.

Right click lib >> Import >> General >> File System >> Next
Browse to the location you put phys2d.jar >> OK
Select phys2d.jar >> Finish

Now your lib folder should have those five jar files in them. Just about done.

We need to add the jar files into the project build path.

Right click the Project >> Properties
On the left, make sure Java Build Path is selected.
Click the Libraries tab >> Add JARs
Expand the Project
Expand lib
Select all of the jar files in the lib directory >> OK >> OK

You should now see a new directory in the Package Explorer called Referenced Libraries. The project is incomplete without first attaching the native libraries to lwjgl.jar. To do that, we first import those native libraries into the project.

Right click lib >> Import >> General >> Archive File
Browse to the unzipped slick directory and
select slick/lib/natives-linux.jar >> OK >> Finish
Do the same for natives-win32.jar and natives-mac.jar
(if you wish to support those operating systems)

Next, we attach those native libraries to the lwjgl.jar file.

Expand Referenced Libraries
Right click lwjgl.jar >> Properties
Select Native Library at the left of that window
Location path: >> Workspace
Expand the Project
Select lib >> OK >> Apply >> OK

Now you are ready to build your awesome game.

But wait, what about using the latest version of lwjgl? We skipped that step.

Right. We did. As of right now, we’re using the the version of LWJGL that came packaged with Slick. However, some users might run into a problem with LWJGL, particularly if you’re using Ubuntu 9.04 (like I am). At this point, if I were to try to compile a Slick program, I would end up with this error:

Failed to initialise the LWJGL display

The solution to which is to use the latest LWJGL native Linux libraries.

Extract that last stable build of LWJGL that you downloaded (
In Eclipse, Right click lib >> Import >> File System >> Next
Browse to the unzipped lwjgl-2.2.0 directory, to lwjgl-2.2.0/native/linux >> OK
Select all of the .so files (all of the files in the directory) >> Finish
Yes To All when asked to overwrite files

Not entirely done yet. Trying to compile now would result in the following error:

Version mismatch: jar version is '16', native libary version is '17'

So we replace the old lwjgl.jar with the new. Find it at lwjgl-2.2.0/jar/lwjgl.jar. Import it into the lib folder of the project. You know how to do that by now. Compile and run again and all should be well.

P.S. You are done with all the extra unzipped directories and zip files, etc. Everything needed to run your project has been imported into Eclipse. They can be deleted if you so choose.

Update: It seems that now there is an additional problem, as follows.

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

The solution was found at the jMonkeyEngine forums. You need to tell the lwjgl.jar where it can find the native libraries so it can run. Basically it calls for

Right click the project >> Properties >> Java Build Path >> Libraries
Expand lwjgl.jar
Select Native Library >> Edit
Click Workspace
Expand the project
Click lib >> OK >> OK

6 Responses to “Slick, Phys2D, LWJGL, and Eclipse”

  1. ArmoredSandwich says:

    Awesome, thanks!

  2. nico says:

    If you do all these steps in a User Library you can reuse the same User Library for all your projects, no need to repeat all these steps every time you start a new project.

  3. nico says:

    And your final remark, the java.lang.UnsatisfiedLinkError, is caused because you incorrectly linked the natives-*.jar to lwjgl.jar. It’s enough to include the natives-*.jar on the classpath like the other libraries, and instead put the native location of lwjgl.jar to the directory which contains the .ddl files.

  4. sonicbroom says:

    brilliant! thanks for sharing this information. i know these things take time!

  5. uzair says:

    can anyone tell me where to download the slick full distribution from because it luks like website is not opening so is there any alternative way to download it???

  6. kyle says:

    No, sorry. The library is pretty old and the original author is no longer maintaining it. I, and many others who used to use Slick, have moved on to libgdx.

Leave a Reply

Staypressed theme by Themocracy