Java System Properties
Quick Reference Guide Java System Property

The java system property is used to set the path to the trusted certificate authority certs file

Default Value

Empty - By default Java will use the cacerts file that ships with the JVM.

Overview of

The system property specifies a file system path to a certificate authority (CA) keystore file. You can typically use the default cacerts file that ships with java, but if you need to add your own internal CA certs, or find that the cacerts file that your JVM is using is out of date you can override it with this system property.

If you are using an outdated version of java, and it is possible to update to a newer version this will be a good approach. Otherwise you will need a method to keep the cacerts file up to date. Trusted certificate authorities may be added, or worse removed/revoked and you should no longer trust certificates which have been revoked.

Other Networking System Properties

Here are some other networking Java system properties:

Supported Since

Java has supported the system property since at least version 1.8, support may go back to even older versions of java.

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/cacerts.jks");

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");