2

I am using following command to import the certificate in KeyStore:

"%JAVA_HOME%"\bin\keytool -importcert -trustcacerts -alias c:\cacert-Service -file c:\e-Service.cer -keystore "%JAVA_HOME%"\jre\lib\security\cacerts

it asked for a password, and show the following result on CMD:

 Certificate was added to keystore
 keytool error: java.io.FileNotFoundException: C:\Program Files (x86)\Java\jdk1.6
 .0_20\jre\lib\security\cacerts (Access is denied)

What is going wrong?

hat
  • 781
  • 2
  • 14
  • 25
Neha Shukla
  • 3,572
  • 5
  • 38
  • 69
  • http://stackoverflow.com/questions/10321211/java-keytool-error-after-importing-certificate-keytool-error-java-io-filenot?rq=1 – Rohit Jun 02 '14 at 12:53
  • This could happen if you are not running the command prompt in administrator mode. If you are using windows7, you can go to run, type cmd and hit Ctrl+Shift+enter. This will open the command prompt in administrator mode. If not, you can also go to start -> all programs -> accessories -> right click command prompt and say run as administrator. – Rohit Jun 02 '14 at 12:53
  • so can put it as answer ? – Rohit Jun 03 '14 at 04:38

2 Answers2

1

Finally I am able to import certificate in Keytool by opening command pompt in administrator mode by using start -> all programs -> accessories -> right click command prompt and say run as administrator

Neha Shukla
  • 3,572
  • 5
  • 38
  • 69
1

This could happen if you are not running the command prompt in administrator mode. If you are using windows7, you can go to run, type cmd and hit Ctrl+Shift+enter. This will open the command prompt in administrator mode. If not, you can also go to start -> all programs -> accessories -> right click command prompt and say run as administrator.

 http://stackoverflow.com/questions/10321211/java-keytool-error-after-importing-certificate-keytool-error-java-io-filenot?rq=1
Rohit
  • 3,401
  • 4
  • 33
  • 60