The Wrapper supports the ability to define environment variables
from within the wrapper.conf file
or from the command line. Once defined, the environment variable
can be referenced like any other environment variable. This includes
use in variable expansion as described above.
Environment variables are defined by using special property names which
begin with "set." or
"set.default." followed by the name
of the environment variable. The value of the property will be the value
of the new environment variable.
set.EXTERN_APP=C:/ExternAppHome
|
If the "set.default." syntax is used,
the environment variable will only be set if it does not yet exist.
This can be useful for defining a series of default environment variable
values.
set.default.EXTERN_APP=C:/ExternAppHome
|
The ability to define environment variables make it possible to easily
modify values that may be used throughout a configuration file. The
example below shows how an environment variable can be used to specify
the location of an external application.
set.EXTERN_APP=C:/ExternAppHome
wrapper.java.classpath.1=../lib/wrapper.jar
wrapper.java.classpath.2=%EXTERN_APP%/lib/jar1.jar
wrapper.java.classpath.3=%EXTERN_APP%/lib/jar2.jar
wrapper.java.classpath.4=%EXTERN_APP%/lib/ext/jar3.jar
wrapper.java.classpath.5=%EXTERN_APP%/lib/ext/jar4.jar
|
The use of environment variables definitions can be very powerful if you
understand how and when their values are set. Environment variables which
were set before the Wrapper is launched can of course be used as usual.
If the same variable name is specified in the configuration file then
the value in the configuration file will override the existing value.
Environment variables defined from the command line work a little
differently. These values will override any values from either the system
or those set in the configuration file. This makes it possible to define
default environment variables within the wrapper.conf
file and then override that value from the command line.
Windows: |
Wrapper.exe -c ..\conf\wrapper.conf "set.EXTERN_APP=C:\Program Files\ExternAppHome"
|
Unix: |
wrapper ../conf/wrapper.conf set.EXTERN_APP=/usr/lib/externapphome
|
NOTE
|  |
Notice that like all properties set from the command line, properties
which include spaces can be defined by including the entire property name,
value pair in quotes.
|
|