JOGL with Proxy opengl32.dll

Hello,
we are developing an application for a 3D Display which requires usage of a proxy opengl32.dll which should be placed in the application directory. This works for my example C++ Application. I tried putting the DLL into the directory of the jar file, the path to the java binary and just about every other path i could imagine as fitting, none worked.

Could anyone please give a hint on how i could use the OpenGL Proxy DLL and which steps i need to follow?

Development environment is eclipse with jdk/jre 1.6.0_04 (Windows XP SP 2).

Thanks.

How did you set up your jogl natives? Normally you specify -Djava.library.path=“path/to/the/jogl-dlls;path/to/the/glugen-dlls” on the commandline while starting a jogl app. So if you put the proxy dll in the same folder as the jog dlls, it should work.

If you have copied the dlls in some kind of system folder, this might be a problem (it is discouraged anyway).

Thanks for your reply.

I didn’t set a path for the jogl dlls as they are in the same folder as the jar file.

Setting -Djava.library.path="/foo/bar" in the eclipse VM settings solved the problem when i run the program from eclipse.

When i export the project as runnable JAR and run it with

java -jar -Dsun.java2d.noddraw=true -Djava.library.path="/same/path/as/in/eclipse" test.jar

it ignores the opengl32.dll in the folder, eventhough the path is the same.

Any hints?

Hum, that is really strange, I can’t think of a reason for this behaviour. However, search your system for occurances of opengl32.dll, jogl.dll and gluegen-rt.dll and list them here. Also try to identify, which java.exe eclipse uses to start from within the IDE. Maybe we can have a better guess with this informations.

I located opengl32.dll in windows\system32 and the project root folder. The jogl.dll, jogl_awt.dll, jogl_cg.dll and gluegen-rt.dll are only in the project root since i deleted them from the export directory to test the library path (The JAR still finds the jogl dlls, without library path it doesn’t even start).

Eclipse uses the C:\Programme\Java\jre1.6.0_04\bin\javaw.exe executable.
I changed the command to start the jar to match this path, but no success yet.

C:\Programme\Java\jre1.6.0_04\bin\javaw.exe -jar -Djava.library.path=“C:\path\to\project\root” -Dsun.java2d.noddraw=true test.jar

… It’s something stupid which i’m just too blind to find, i know it …

Hmm no. Seems ok. Try forward slashes for java.library.path, but I doubt, that this is the problem… Can you see the full commandline when starting from within eclipse?

Ok, correction and (partly) solution:

As i didn’t notice before when i was searching for the opengl32.dll (well, it’s already 12 minutes past end of my workday) it was also located in the path of the javaw binary and this seems to be the path from where it had included the opengl32.dll. As soon as i removed the dll from this folder, the program didn’t use the dll in eclipse, too.

With the path set to the same javaw binary when starting the jar it uses the dll, too, as long as it’s in the java bin folder.

This is not what i wanted, but still a step in the right direction.