Default environment variables

You can configure environment variables in your Open Liberty server.env file to customize the Open Liberty environment. The properties are set in KEY=value format.

For more information about configuring the server.env file, see Server configuration overview: server.env.

The following table lists the default Open Liberty environment variables and gives a brief description for each variable:

Open Liberty default environment variables
Environment VariableDescription

JAVA_HOME

Specifies which Java runtime environment (JRE) to use. If this variable is not set, the system default is used.

JVM_ARGS

Specifies a list of command-line options, such as system properties or -X parameters, that are passed to the JVM when the server starts. Any values that contain spaces must be enclosed in quotation marks.

LOG_DIR

Specifies the directory that contains the log file. The default value is %WLP_OUTPUT_DIR%/serverName/logs.

LOG_FILE

Specifies the log file name. This log file is used only if the server start command is run in the background through the start action.

SERVER_WORKING_DIR

Specifies the directory that contains output files from the JVM that the server uses, such as the javadump files. The default value is the ${WLP_OUTPUT_DIR}/serverName location. If this variable is set to a relative path, the resulting path is relative to this default location. For example, a value of SERVER_WORKING_DIR=logs/javadumps results in a path of ${WLP_OUTPUT_DIR}/serverName/logs/javadumps.

VARIABLE_SOURCE_DIRS

Specifies the directories that contain files to be loaded as configuration variables. The default value is ${server.config.dir}/variables. To define a list of directories as the value for this variable, separate each directory with the path separator for your operating system. For Windows, the path separator is a semicolon (;). For Unix-based systems, the path separator is a colon (:).

WLP_USER_DIR

Specifies the user or custom configuration directory that is used to store shared and server-specific configuration. See the path_to_liberty/wlp/README.TXT file in your server configuration for details about shared resource locations. A server configuration is at the %WLP_USER_DIR%/servers/serverName location. The default value is the usr directory in the wlp directory.

WLP_OUTPUT_DIR

Specifies the directory that contains output files for defined servers. This directory must have both read and write permissions for the user or users who start servers. By default, the server output logs and work area are stored at the %WLP_USER_DIR%/servers/serverName location, alongside configuration and application files. If this variable is set, the output logs and work area are stored at the %WLP_OUTPUT_DIR%/serverName location.

WLP_DEBUG_ADDRESS

Specifies the port to use for running the server in debug mode. The default value is 7777.

WLP_DEBUG_SUSPEND

Specifies whether to suspend the JVM on startup. Set this variable to y to suspend the JVM on startup until a debugger attaches, or set to n to start without waiting for a debugger to attach. The default value is y.

WLP_DEBUG_REMOTE

Specifies whether to allow remote debugging. Set this variable to y to allow remote debugging. By default, this value is not defined, which does not allow remote debugging on newer JDKs and JREs.