How does JOGL look for OpenGL libraries?

I am writing a desktop application using JOGL and deploying it to Win / Mac / Linux. On Linux, we find that the installed OpenGL libraries do not always match the job, and we need to be able to switch our own OpenGL software emulation. Naturally, we expected that we could place libraries after / usr / lib or before / usr / lib in our favor or by default.

It turns out that we prefer JOGL. Does anyone know if JOGl libraries do special handling in search of libGL, etc. Preferring a later version to an earlier one? Any information is appreciated.

+4
source share
1 answer

I assume that the Java side of JOGL uses JNI (Java Native Interface) to interact with native libraries. JNI uses the Java system variable java.library.path to find the native libraries. You can install it on the command line using the -D switch when starting a Java application:

java -Djava.library.path=/some/path mypackage.MyProgram 

It may also be that your own system does not pick up the correct OpenGL libraries. On Linux, you can set the environment variable LD_LIBRARY_PATH to indicate where Linux should look for shared libraries. This page explains more (see section 3.3.1).

Please note that you can get the JOGL source code on the JOGL homepage, so if you really want to know, you can download it and start digging into it.

(why is there a silly restriction "new users can send only one hyperlink" ????)

+3
source

All Articles