java.io.FileNotFoundException: (Operation not allowed) error with ./keytool -import on mac osx (el capan) - Java 6 [英] java.io.FileNotFoundException: (Operation not permitted) error with ./keytool -import on mac osx (el capitan) - Java 6

查看:28
本文介绍了java.io.FileNotFoundException: (Operation not allowed) error with ./keytool -import on mac osx (el capan) - Java 6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将 CA 证书导入我的 Java 6 信任库,但遇到此错误:

Trying to import a CA Cert to my Java 6 truststore and am running into this error:

./keytool -v -import -trustcacerts -alias Rapidssl -file /Users/spurr/Desktop/rapidssl.cer -keystore /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts
Enter keystore password:
Certificate was added to keystore
[Storing /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts]
keytool error: java.io.FileNotFoundException: /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts (Operation not permitted)
java.io.FileNotFoundException: /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts (Operation not permitted)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:84)
at sun.security.tools.KeyTool.doCommands(KeyTool.java:902)
at sun.security.tools.KeyTool.run(KeyTool.java:172)
at sun.security.tools.KeyTool.main(KeyTool.java:166)

我也以 root 身份运行该命令,因此我认为我可以访问该 cacerts 密钥库位置.使用 Java 6.

I'm running that command as root as well so I'd think I have access to that cacerts keystore location. Using Java 6.

推荐答案

当异常状态为 (Operation not allowed) -

对于遇到此问题的其他人,您需要重新启动 Mac 并在启动时按 ⌘+R.然后进入 Utilities > Terminal 并输入以下命令:

For anyone else having this problem you need to reboot your mac and press ⌘+R when booting up. Then go into Utilities > Terminal and type the following commands:

csrutil disable
reboot

您应该能够在此之后将 cacerts 导入您的 Java 密钥库.导入该 cacert 后,不要忘记重新启用 csrutil.重启,开机按⌘+R,Utilities > Terminal,输入:

You should be able to import cacerts to your Java keystore following that. Don't forget to reenable csrutil after you've imported that cacert. Reboot, press ⌘+R when booting up, Utilities > Terminal, enter:

csrutil enable
reboot

这篇关于java.io.FileNotFoundException: (Operation not allowed) error with ./keytool -import on mac osx (el capan) - Java 6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆