Reputation: 10303
This question has been asked several times but none of the solutions work for me. I running the DOS command window as Administrator, but when running the keytool command to install a certificate I get the error above:
C:\Program Files\Java\jdk1.8.0_191\jre\lib\security>keytool -import -file xxx.yyy.zzz.crt -alias xxxx.yyy.zzz.com -keystore cacerts -storepass changeit -noprompt
Certificate was added to keystore
keytool error: java.io.FileNotFoundException: cacerts (Access is denied)
I'm on Windows 10 with JDK 1.8.0_191. Why would access be denied to the Administator?
Upvotes: 1
Views: 26129
Reputation: 41
I have faced the same issue.
Here is the solution what I found:
Upvotes: 4
Reputation: 1690
"Run as administrator Command prompt" has fixed this issue at Windows.
Upvotes: 6
Reputation: 10303
My problem was that I did not have true admin rights to my Windows 10 laptop. I had enough permissions to install the JDK to the default location (which requires admin rights), but not enough rights to use keytool.
I uninstalled the JDK from the default location and reinstalled it in a directory that was not restricted to admin users. Then keytool worked properly.
Upvotes: 2