I need to import a certificate for some maven repositories into the global keystore. The certificate file is named maven.crt so the command I am running is
keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -alias maven -file maven.crt
It asks me for password and then if I trust the certificate to which I answer yes This is the final output
Certificate was added to keystore
keytool error: java.io.FileNotFoundException: /usr/java/jdk1.7.0_40/bin/java/jre/lib/security/cacerts (Not a directory)
I ran this command as root so I don't know why I am receiving permissions error here.
You need to give it the correct full path to your keystore. the keystore file is here C:\Documents and Settings\Shalini\. android> so when i enter C:\Documents and Settings\Shalini\. android>keytool -list -alias androiddebugkey -keystore .
keytool error: java.io.FileNotFoundException: C:\Program Files (x86)\Java\jre1.8.0_45\lib\security\cacerts (Access is denied) This issue occurs because the Windows User used to run the command, does not have access to update the Java TrustStore file 'cacerts'. Solution.
Your path is wrong. cacerts file is in jdk_directory/jre/lib/security.
Try this instead:
keytool -import -keystore /usr/java/jdk1.7.0_40/jre/lib/security/cacerts -trustcacerts -alias maven -file maven.crt
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