Java System Properties
Quick Reference Guide Java System Property

The Java System Property accepts a file path to load java security properties.

Overview of

If the Java Security Property security.overridePropertiesFile is set to true (the default), then the security properties of the JVM can be overridden by values specified in the properties file that is pointed to via the system property.

Full Override

If the system property is set with two equal signs, == then that file will completely override the master security properties file (shipped with the JVM).

Setting on Startup

You can set the java system property during startup of the java runtime using the -D command line argument:

java MyAppMain

You may also be able to specify via the JAVA_TOOL_OPTIONS environment variable:

Setting / Reading at Runtime

You can set at runtime with the following Java code:

System.setProperty("", "/path/to/");

WARNING: Depending on the property and JVM version using setProperty may or may not work if the JDK Java class that uses this variable has already been loaded. The value of the system property may be cached within an internal private static variable of the implementing class.

To read the value of at runtime, you can use this Java code:

String propertyValue = System.getProperty("");
if (propertyValue != null) {
    System.out.println(" = " + propertyValue);
} else {
    System.out.println(" was null");