Java System Properties
Quick Reference Guide


security.overridePropertiesFile Java Security Property

The security.overridePropertiesFile Java Security Property accepts an boolean value which determines if security properties can be overridden by those specified via the java.security.properties system property.

Default Value

true

Setting / Reading security.overridePropertiesFile at Runtime

You can set security.overridePropertiesFile at runtime with the following Java code:

java.security.Security.setProperty("security.overridePropertiesFile", "/path/to/security.properties");

Please note that the security.overridePropertiesFile value needs to be specified early, before the internal java classes are loaded that might use this value otherwise it will be ignored.

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

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

Setting security.overridePropertiesFile on Startup

Be aware that security.overridePropertiesFile is not a Java System Property, it is a Java Security Property. Therefor you cannot set it from the command line using -Dsecurity.overridePropertiesFile. You have to set security.overridePropertiesFile in the java.security properties file.