Java System Properties
Quick Reference Guide


policy.allowSystemProperty Java Security Property

The policy.allowSystemProperty Java Security Property accepts an boolean value which determines if security properties can be loaded via the java.security.properties system property. This property also determines if login config can be loaded via the java.security.auth.login.config system property.

Default Value

true

Setting / Reading policy.allowSystemProperty at Runtime

You can set policy.allowSystemProperty at runtime with the following Java code:

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

Please note that the policy.allowSystemProperty 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 policy.allowSystemProperty at runtime, you can use this Java code:

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

Setting policy.allowSystemProperty on Startup

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