Runnable JAR files
Runnable JAR files contain applications, server configurations, and an Open Liberty installation.
For information about packaging a JAR, see the server package
command.
When a JAR file runs, it gets extracted to a temporary location and the server runs in the foreground. By default, files are extracted to wlpExtract/<jar file name>_nnnnnnnnnnnnnnnnnnn
in the user home directory. You can control the output location by using the WLP_JAR_EXTRACT_ROOT
or WLP_JAR_EXTRACT_DIR
environment variables.
Variable syntax
When you run Open Liberty from a runnable JAR file you can define variables at startup by using the following syntax:
java -jar myServer.jar --variable1_name=variable1_value --variable2_name=variable2_value
You can specify multiple variables with this format. Variables that are specified on the command line override all other sources of variables and can’t be changed after the server starts.
Environment variables
For information about specifying environment variables, see Server configuration overview. The following table lists environmental variables that you can specify to work with runnable JAR files. Column one contains the environmental variable and column two contains a description of the variable.
Environment variable name | Description |
---|---|
| Extracts the JAR file to the |
| Extracts the JAR file to the |
| Writes Open Liberty server output files to the By default, server output is written to the extraction directory, which is deleted when the server stops. If you want to save the output, specify a durable output location by using the |
| Runs an Open Liberty server by using |
| Set to value By default, two-phase commit transactions are disabled because the transaction logs are in the expansion directory and are deleted when the Open Liberty server stops. Therefore, transaction recovery is not possible. To enable two-phase commit transactions, configure the transaction log to be in a durable location in the file system or an RDBMS, and set the To configure the transaction log, use either the |
| Set to value Run under the bash shell, not mintty. Automatic extraction file deletion occurs only when you run under the bash shell. You can run under mintty, but you must delete the extraction files manually. Mintty does not forward the necessary signal that is required to trigger Java shutdown hooks. |