Hosted by:

Paths in Configuration Properties

Paths in Configuration Properties

Configuration Property Overview

- Configuration Property Overview

Paths in Configuration Properties

Java handles both forward slashes, `'/'`, and backslashes, `'\'`, correctly on Windows. To make your `wrapper.conf` cross platform compatible, you should always use forward slashes in all paths in `wrapper.conf`.

At startup, the Wrapper always sets its current working directory to the location of the Wrapper executable. When the Wrapper launches Java, its working directory will remain the same, making relative path references function reliably.

On Linux and UNIX versions, the `sh` script which ships with the Wrapper will change set the working directory to the location of the script. This is required so that relative paths will always work correctly even when the script used to launch the Wrapper is referenced using a symbolic reference.

The above functionality on all platforms makes it possible to make all file references in the configuration file use relative paths. Relative paths are preferable in most cases because they make it easy to install an application at any location and then it work correctly without modification. In most cases relative file references will also work on all platforms.

The example configuration file fragments below show how some property values which use static platform specific paths can be modified to use relative paths. Note that there is nothing platform specific in the second version of the properties. This example assumes that the Wrapper binaries and scripts are located in a bin directory under the application's home directory. The application also contains its own JRE to make installation easier for users.

Fixed path properties:

    wrapper.java.command=C:/MyApp/jre/bin/java
    wrapper.java.classpath.1=C:/MyApp/lib/wrapper.jar
    wrapper.java.library.path.1=C:/MyApp/lib
    wrapper.logfile=C:/MyApp/logs/wrapper.log

Relative path properties:

    wrapper.java.command=../jre/bin/java
    wrapper.java.classpath.1=../lib/wrapper.jar
    wrapper.java.library.path.1=../lib
    wrapper.logfile=../logs/wrapper.log

by Leif Mortenson

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