0

I'm trying to import a security certificate so that I can send requests to a server, following the steps here.

http://www.grim.se/guide/jre-cert

I enter the following command at the Windows command prompt.

keytool -import -alias sunas -keystore "C:\Program Files\Java\jre1.8.0_91\lib\security\cacerts" -file C:\Users\dan.moore\Desktop\V-CLOUD-ROOT-CA.der

I'm then prompted for a password, which I enter as "changeit".

Then this happens -

Trust this certificate? [no]:  y
Certificate was added to keystore
keytool error: java.io.FileNotFoundException: C:\Program Files\Java\jre1.8.0_91\lib\security\cacerts (Access is denied)

Since access was denied, I assume I don't have write privileges to the JRE. How can I get this? Thank you!

  • 1
    Turns out question asked and answered here - http://stackoverflow.com/questions/10321211/java-keytool-error-after-importing-certificate-keytool-error-java-io-filenot –  May 19 '16 at 20:38
  • 2
    Open the command prompt as administrator and run the same. – randominstanceOfLivingThing May 19 '16 at 20:38
  • Since my question is a duplicate, should I just delete it? –  May 19 '16 at 20:40
  • 1
    Isn't closing it as duplicate better? So that it will be easier for other users to find the answer provided in the other thread? – Aaron May 19 '16 at 20:41
  • Already has answers, so I can't. Ah well. Accepting Aaron's answer. –  May 19 '16 at 20:42

2 Answers2

0

Windows Defender was blocking access to the cacerts file. Try to disabled the brick wall tool and everything will be good now!

0

This isn't a problem, but rather a permission problem from your OS. Since you appear to be running windows, you might want to execute your command as an administrator. To do so, the easiest way will be to launch a command line as an administrator (search cmd from the launch menu, right click on the result, start as an administrator...). You might be prompted for credentials.

Aaron
  • 24,009
  • 2
  • 33
  • 57