Help to setup lwjgl in intellijIdea

Hi to all,

im beginer in game programing I try tu run example, but I cannot find out, how in intellij idea, set the lwjgl.

I have lwjgl.jars added in project and i try to setup this -Djava.library.path="C:lwjgllwjgl-2.0rc2nativewin32"

to enviroment variables when I run main class, but I still get java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path.

And a few hours i dont have Idea how to setup this.

Somebody who knows inteliij idea and know how to resolve it?

thanks for any issue.

toneofwinds form CZ

this isn't an intellij thing… there are two ways around this 1 is to put your dlls into your classpath (e.g. your windows/system32 directory (which I don't recommend) or put the jar with the dlls into your classpath which is done via project dependencies in your settings menus (ctrl+alt+s unless you're on a mac and then you're hosed, cause I don't know what it is except File->Settings)

Let me know if you have any other questions… I have been using IntelliJ for 6-ish years now


Hi timo,

I got it, I setup java.library.path to VM parameters… before I tried setup this in Enviroment property.

But from your text is meybe possible add dll files to class path. I cannot set this. If I setting libray in module lybray or global lybrary I see only atach classes or add jar directory.

I tried averything what I can imagine but no dll in classpath.

Do you have litle time to descibe it?

Petr from CZ sorry for my Engllish

PS: I have another problem with java.lang.NoClassDefFoundError: org/lwjgl/opengl/glu/GLU

I download lwjgl 1.1.4 and all work

In order to add dlls into the classpath you will have to add them via a jar… meaning you can either jar them up, or find the jar with the dlls in it (I have created a jar with the dlls in it).

As for the no class def found that class is in the lwjgl.jar you'll have to add that to your dependencies as well (either single file, or you can add them as a library (global, module, project).

ask if you have any more questions.


Adding dlls or jars with dlls to your classpath does not help, unless you implement a special loading routine, which extracts the dlls from the classpath and loads them manually (not easily possible with lwjgl).

So -Djava.library.path=xyz is the way to go.

I've had no problems with running this way in intellij, but you're right.  I'll double check my path and see if there's a set of the dlls in the paths somewhere that I don't know about.  intellij pushes the java.library.path upfront when you run the code in the IDE.

Ok, so I checked… and, not that I doubted your wisdom irrisor but, you were right.  I had a folder with the dlls and a jar with the dlls.  In my application run I have the -Djava.library.path= setup to go to the local dll folder every time.  I also have the jar with the dlls for, I am guessing by the listings, for webstart, I think.