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)
I'm running that command as root as well so I'd think I have access to that cacerts keystore location. Using Java 6.
I was hit by similar issue on MacOS Big Sur while starting an jnlp file:
CouldNotLoadArgumentException[ Could not load file/URL specified: /Users/jhartman/Documents/Favorities/NCC/NCC 123.jnlp]
....
Caused by: java.io.FileNotFoundException: /Users/jhartman/Documents/Favorities/NCC/NCC 123.jnlp (Operation not permitted)
Solution for this was:
/usr/bin/java
) Full Disk access/usr/bin/java
) Files and Folders access to Downloads, Documents and FoldersSteps
/usr/bin
in Finder, e.g. by invoking from Terminal:jhartman@MBP ~ % open /usr/bin
Localise java
(and keytool
)
Open System Preferences and Security & Privacy. Open Full Disk Access tab and authorise
Drag java
and keytool
from Finder window opened in step 1 and drop onto the App list in Full Disk Access
java
and keytool
It was solution for my problem but I hope it should also sort out keytool
issue.
This seems to be a mac specific issue when the exception states (Operation not permitted)
-
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With