wrapper.system.library.path.<n>

Compatibility :3.6.0
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/Linux

Some native libraries reference 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 of the operating system.

These properties are used to specify a list of directories in which to look for any secondary libraries which are loaded using the default mechanism of the operating system. The configured paths will apply to any subprocesses of the Wrapper.

<n> component:

Each element has a property name which starts with wrapper.system.library.path. and the "<n>" component of the property name is an integer number counting up from "1". By default, there can be no missing numbers. The wrapper.ignore_sequence_gaps property can optionally be set to allow gaps in the sequence.

Example:
wrapper.system.library.path.1=../lib

NOTE

The wrapper.system.library.path.<n> properties were first introduced in Wrapper version 3.6.0. Earlier versions of the Wrapper could set path for secondary libraries by manually settings environment variables.

On Windows, the system will first look in the current working directory (The location of the wrapper.exe), then it will look in the Windows system32 directory and the Windows directory. Finally, it will search the entire system PATH. If both DLLs are located in your application's lib directory, it may be necessary to add its location to your system path as follows. The set.PATH is for Windows and the set.LD_LIBRARY_PATH makes the configuration file cross platform so it works on UNIX systems as well. Mac OSX also makes use of the set.DYLD_LIBRARY_PATH variable.

set.PATH=..%WRAPPER_FILE_SEPARATOR%lib%WRAPPER_PATH_SEPARATOR%%PATH%
set.LD_LIBRARY_PATH=..%WRAPPER_FILE_SEPARATOR%lib%WRAPPER_PATH_SEPARATOR%%LD_LIBRARY_PATH%
set.DYLD_LIBRARY_PATH=..%WRAPPER_FILE_SEPARATOR%lib%WRAPPER_PATH_SEPARATOR%%DYLD_LIBRARY_PATH%

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.

Platform specific native libraries

Most libraries expect their native libraries to be named the same for all platforms. This usually results in having to release platform specific distributions of an application. By defining the library path as follows however, the Wrapper will dynamically reference the correct platform specific directory at run time, making it possible to include all supported platforms in a single distribution of Wrapper.

Example:
wrapper.system.library.path.1=../lib
wrapper.system.library.path.2=../lib/native/%WRAPPER_OS%-%WRAPPER_ARCH%-%WRAPPER_BITS%

Which resolves to the following:

Windows:
wrapper.system.library.path.1=../lib
wrapper.system.library.path.2=../lib/native/windows-x86-32
Linux:
wrapper.system.library.path.1=../lib
wrapper.system.library.path.2=../lib/native/linux-x86-32
Solaris:
wrapper.system.library.path.1=../lib
wrapper.system.library.path.2=../lib/native/solaris-sparc-32

Reference: Library