HowTo: How to configure library path for JNI dependent libraries |
||||||||
Java loads native libraries (JNI) by searching the path defined with the
java. The following example will set up a library path that will search for JNI libraries in the ../lib/ and ../lib2/ directories:
This is sufficient for most JNI libraries. However, some libraries themselves make use of other dynamically linked libraries. Java will locate the initial JNI library using the Java library path, but the secondary libraries are loaded using the default mechanism for the platform.
On Windows, the system will first look in the current working directory
(the location of wrapper.
Note that placing the secondary library on the PATH rather than in the current working directory has a risk that an old version of the library could be encountered first in the Windows system32 directory if it was installed by another application. This is due to the order in which the system looks for the file. This problem has been seen when working with SAP's JCO libraries if other SAP applications are also installed on the system.
Please see the documentation for the
wrapper. |