My requirement is to import a certificate for maven repositories into the global keystore.
The certificate file is named maven-cacert.cer .
I am using following command from C:\Program Files\Java\jdk1.6.0_20\bin\
from cmd
keytool -importcert -trustcacerts -alias c:\maven-cacert.cer -file c:\maven-cacert.cer.der -keystore $JAVA_HOME\jre\lib\security\cacerts
as maven-cacert.cer
file is in C
directory
after pressing enter it asked to put password and after giving password it is saying like
keytool error: java.io.FileNotFoundException: $JAVA_HOME\jre\lib\security\cacerts (The system cannot find the path specified
I also tried
keytool -importcert -trustcacerts -alias c:\maven-cacert.cer -file c:\maven- cacert.cer.der -keystore \usr\java/jdk1.6.0_20/bin/java\jre\lib\security\cacerts
but getting same output
Please help what is going wrong with my command while cacerts
file is inside $JAVA_HOME\jre\lib\security\
directory.
You can inspect (list) certificates in your cacert keystroke using the java keytool. keytool has to be in your path, or can be found in the bin directory of your Java Installation (e.g. C:/Program Files (x86)/Java/jre1.
Try using "%JAVA_HOME%\jre\lib\security\cacerts"
If you are using OpenJDK then the path for cacerts
will not be available in
"%JAVA_HOME%"/jre/lib/security/cacerts
it will be available in path
"%JAVA_HOME%"/lib/security/cacerts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With