Can't Load up the Jogl Library

Ive followed the instructions on http://www.java-gaming.org/forums/index.php?topic=1474.0 and I’ve gotten the same problem that a lot of other people have gotten.

When I run the line of code:
System.loadLibrary(“jogl”);

I get that “UnsatisfiedLinkError”.

I’m currently using IntelliJ and I’ve added the jar files to the IDE as libraries. The syntax of my code isn’t showing up in red, but when I test the code, it just throws that unsatisfied link error.

I’ve read the instruction thread about how other people have this same problem and it seems nobody has found a solution.

Also, when I run my program in IntelliJ, it outputs the command it used to run the it used to run the code and the two jar files are set in its class path.

I have no idea what to do and would appreciate any help.

use an old jre like 1.3 or something

You need to have -Djava.library.path= set to the directory containing jogl.dll and the other DLLs from one of the zip archives. I don’t know how you should set this in IntelliJ though.

if you don’t find the library path it is always possible to use the current working directory (“CWD”) referenced as “.” in File classes. Put your libs with natives nearby the main .jar of your application and System.loadLibrary() will look into it!

Thanks broumbroum , that has worked, I can now use the jogl library properly.

But I would still prefer if the dll’s weren’t in my current working directory. Does anyone know the proper way to setup library paths in IntelliJ?

Click on the dropdown beside the play button. Click “Edit Configurations”. Select the build/run-profile of your app (there probably is just one called like your main class). Enter


-Djava.library.path=/path/to/the/directory/containing/the/natives

in the line wich is labeled “VM parameters”

Thanks cylab, it works perfectly now.