It works but don't know why

This is going to be an odd question.

A JOGL project knows about the root directory the executable jar file is in. So because of this, any platform specific binary I put in there, it is found and loaded. No problems.

I started a standard java project in netbeans 6.7 to make a simple 2D game that just uses Image and BufferedImage for old fashioned double buffer blitting. I added the java jar and binaries for lwjgl and OpenAL32 to add OpenAl sound. Works fine when running in the NetBeans development environment but the distribution won’t load the binaries. It will work from the command line if I pass the root directory via -Djava.library.path=.

So the question is, why don’t I have to jump through these hoops when it’s a JOGL project? What magic has been done here?

Hmm :slight_smile:

This is only true for windows where the current working directory is implicitely added to the path, which is used as standard java.library.path for windows. So under linux (mac?) you would explicitely have to specify java.library.path (or add the natives manually to the systems library search path)

hmm, should have worked under windows… are you sure, you were in that directory when trying to run the jar?

It shouldn’t matter, but is your “JOGL project” from the opengl pack template or also a standard java project?

you are correct. Since it seemed like it works automatically under windows, I just assumed it would be the same under Linux and Mac. I tried this with one of my JOGL apps on my linux box. I’m such a noob.

Too bad the executable java jar won’t look in it’s own folder for other files. I know it’s a security issue behind this but it sure would make life easier if it did.