Hosted by:

wrapper.java.library.path.<n> Property

wrapper.java.library.path.<n> Property

Configuration Property Overview

- Configuration Property Overview
- JVM Configuration Properties
- Property List by Name

wrapper.java.library.path.<n>

Java library path to use. You should have a series of properties listing up the various library path elements to use when launching the application. Each element has a property name which starts with `wrapper.java.library.path.` and ends with an integer number counting up from 1. There can be no missing numbers.

The library path is used to specify a list of directories in which to look for any native (JNI) libraries used by the application. You must place the `wrapper.dll` (for Windows) or `libWrapper.so` (for Linux and Unix) file in one of the directories specified.

Example:

    wrapper.java.library.path.1=../lib

If is also possible to get the default Java behavior by requesting that the system path be appended to the end of the java library path generated by the Wrapper. Please read the documentation, associated with the wrapper.java.library.path.append_system_path property before doing so.

NOTE MEG |  | On Windows, the Wrapper will correctly handle path elements which contain spaces by enclosing the final combined library path in quotes. Individual library path elements should not be quoted even if they contain spaces.

NOTE MEG

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 for the platform.

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 PATH is for Windows and the LD_LIBRARY_PATH makes the configuration file cross platform so it works on Unix systems as well.

    set.PATH=..%WRAPPER_FILE_SEPARATOR%bin%WRAPPER_PATH_SEPARATOR%%PATH%
    set.LD_LIBRARY_PATH=..%WRAPPER_FILE_SEPARATOR%bin%WRAPPER_PATH_SEPARATOR%%LD_LIBRARY_PATH%

Not 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

The Wrapper also provides a facility to make it easy to create binary distributions that run on any platform, even if the application makes use of native libraries.

In the case of the Wrapper's native library, the Wrapper is intelligent about the way it locates its native component. The library can be named in such a way that it contains the current OS name, platform name, and bit depth. Examples are: `wrapper-windows-x86-32.dll` and `libwrapper-linux-x86-32.so`.

Most libraries do not support this kind of feature however and 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.

Example:

    wrapper.java.library.path.1=../lib
    wrapper.java.library.path.2=../lib/native/%WRAPPER_OS%-%WRAPPER_ARCH%-%WRAPPER_BITS%

Which resolves to the following:

Windows:

    wrapper.java.library.path.1=../lib
    wrapper.java.library.path.2=../lib/native/windows-x86-32

Linux:

    wrapper.java.library.path.1=../lib
    wrapper.java.library.path.2=../lib/native/linux-x86-32

Solaris:

    wrapper.java.library.path.1=../lib
    wrapper.java.library.path.2=../lib/native/solaris-sparc-32

by Leif Mortenson

Copyright ©1999-2004 by Tanuki Software. All Rights Reserved. | last modified: