Importing the certificate to the Java certificate Keystore
To import the certificate into your Java certificate keystore, follow the steps below:
-
Open the console.
-
Set the
JAVA_HOME
variable and thePATH
variable. -
Navigate to the
$JAVA_HOME/lib/security
folder and run the following command:keytool -import -alias <aliasname> -keystore cacerts -file <generated certificate path>
For the alias, use any name.
For the file, specify the path of the exported certificate, including the file name. -
You are now asked to enter the password. Enter your Java keystore password (the default password is
changeit
). -
Type yes, to confirm that you trust this certificate.
The certificate is saved successfully.