How to add all certificates to the "cacerts" in a JDK/JRE

  • KM03608269
  • 17-Mar-2020
  • 17-Mar-2020

Summary

How to add all certificates to the "cacerts" in a JDK/JRE

Question

In some cases it might be necessary to add multiple certificates to the cacerts file in a JDK or JRE.

This process in Linux allows us to add one or many at once.

Answer

Verify the JAVA_HOME environment variable is set

In a shell type: echo $JAVA_HOME

If the path to the JDK or JRE is revealed then continue. If not then resolve your JAVA_HOME environment variable

To automatically install certificates into the JVM/JRE used by Linux, drop the certificate(s) into the folder...
/etc/pki/ca-trust/source/anchors

The run the command...
update-ca-trust