Permission error when importing certificate to cacerts

我的未来我决定 提交于 2019-12-09 18:01:10

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/19186817/permission-error-when-importing-certificate-to-cacerts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!