Setting up LWJGL with Eclipse

This tutorial will run you through the steps you'll need to get LWJGL setup with the Eclipse IDE.

This can be tricky if you are not familiar with the IDE because unlike most Java libraries LWJGL has two parts, a Java part (lwjgl.jar) and a native code part (*.dll files for Windows, *.so files for linux and *.dylib/*.jnilib for Mac). Both parts must be set in order to use the library.

Firstly download LWJGL from its sites download page. You'll just want the standard download bundle (, you can ignore the source, docs and applet bundles for now.

Extract the contents of the bundle to somewhere on your computer, it does not have to be in any specific location. Do not put it in the Java installation directory.

Next start up Eclipse and create a new project.

Then right click the project and choose properties.

Next select 'Java Build Path' and then the 'Libraries' tab.

Add lwjgl.jar as an external jar by clicking the 'Add External Jars..." button.

If you intend to use OpenGL's GLU class you should also add lwjgl_util.jar. If you are using the Slick2D library then you should also add slick.jar here.

Finally we need to setup the native component of LWJGL. This is done by clicking the little arrow next to the lwjgl.jar file to show the drop down list. Double click 'Native library location' and select the folder that contains the native files for your operating system and clicking OK. These are located in the natives folder include in the LWJGL download bundle (e.g. On Windows you'd point to the natives\windows folder which contains the *.dll files, On Mac you'd point to the natives/macosx folder and on Linux you'd point to the natives/linux folder).

That's it, you now have LWJGL setup with Eclipse and can begin coding.


so, I downloaded the lwjgl file, but when I tried to enter the location of native libraries,I just realized that there is no "natives" folder. Only a "native" folder that does not have any .dll files in it. What should I do?

Anonymous Ninja
Wed, 09/09/2015 - 14:49

So I went to the online site and downloaded the LWJGL zip (it's at version 2.8.5 at this point.) But that zip file didn't have any .jar files! What's going on here? Did they upload a bad version or something?

Anonymous Ninja
Sun, 02/03/2013 - 22:43

Thanks, mate, you just saved my life :)

Anonymous Ninja
Sun, 07/08/2012 - 05:49

absolute hero saved my life!

Anonymous Ninja
Wed, 10/10/2012 - 09:44


I *JUST* got Eclipse successfully installed & am trying to get it to point to the correct location, so that I can do game development with Eclipse & LWJGL. But only my Eclipse install has gone correctly. I extracted the LWJGL files to C:\LWJGL as it's destination, but I do not see any folders named 'natives'. Additionaly, I also downloaded the 32-bit JDK (don't know how to install that). The JRE was an executable & did it's own thing nicely. So any advice you can give here is really helpful!

Anonymous Ninja
Wed, 06/06/2012 - 21:12

did you grab the right lwjgl package? at the time of this post the latest version is lwjgl 2.8.4, make sure you grab this file

Wed, 06/06/2012 - 21:34

I am working on a game with LWJGL, Slick and SoundSystem (by paulscode @ and I have done this setup with eclipse tonnes of times and everything works but when I go File > Export (opens a dialog) Java > Runnable Jar or something like that then export the game to a jar. When I run the game it comes up with this:

C:\Users\17082>java -jar D:\17082\Desktop\Game.jar
Starting main thread...

Starting up SoundSystem...
Initializing OpenAL
(The lwjgl binding of OpenAL. For more information, see http://www.lwjgl.or
Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: no lwjgl in java.
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$
at Method)
at org.lwjgl.Sys.doLoadLibrary(
at org.lwjgl.Sys.loadLibrary(
at org.lwjgl.Sys.(
at org.lwjgl.openal.AL.(
at paulscode.sound.LibraryOpenAL.init(
at paulscode.sound.SoundSystem.CommandNewLibrary(
at paulscode.sound.SoundSystem.CommandQueue(
SoundSystem did not load after 30 seconds.
SoundSystem did not load after 30 seconds.
SoundSystem did not load after 30 seconds.
Cleaning up!
Exception in thread "Main Thread" java.lang.NoClassDefFoundError: Could not init
ialize class org.lwjgl.opengl.Display
at src.Game.cleanup(
at Source)

I tried running it with this command: java -jar [jarfile] -Djava.library.path=[natives path]
but nothing works! I have been looking at like everywebsite trying out the solutions but
I must be doing something wrong please help!!!

Anonymous Ninja
Sat, 09/17/2011 - 15:14

The above error just means you haven't setup the native component of LWJGL properly, see the end part of the above tutorial and try again.

Sat, 09/17/2011 - 18:24

Helo, I have the same error when I try to launch my jar after compiled it with Eclipse.
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/opengl/Display
But on Eclipse the application launch properly. (and I made all what is said in the tutorial about the .dll)

Anonymous Ninja
Wed, 07/25/2012 - 15:52

Solved my problem with a command line launching code.

Anonymous Ninja
Wed, 07/25/2012 - 16:19

Where exactly would I find these "native files," specifically for Mac OS X?

Anonymous Ninja
Wed, 04/20/2011 - 16:41

once you download the LWJGL download bundle, you'll find them in the folder natives/macosx

Wed, 04/20/2011 - 19:55

How can you add the native files for multiple OSs to the same project, so that it works on both os x and windows, for example

Anonymous Ninja
Thu, 12/01/2011 - 18:49

You just include them all, LWJGL will automatically detect which OS its on and load only the required natives.

Thu, 12/01/2011 - 20:34