Reputation: 71
I am trying to get a dump of my Java keystore content, I am trying with the following query in terminal:
keytool -list -v -keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/security/cacerts > java_cacerts.txt
it throws the following error:
-bash: java_cacerts.txt: Permission denied
I already tried changing permissions on several folders also on the cacerts file itself but without any results.
What could be the problem?
Upvotes: 0
Views: 1805
Reputation: 55
I've run recently into a similar problem.
If you run the same command with Administrator rights, you'll be able to generate the file without problems.
Upvotes: 0
Reputation: 71
The given answers lead to the solution. I added a different (100% sure writable) location before the java_cacerts.txt and it was able to write now. Thank you! :)
Upvotes: 0
Reputation: 2841
You don't have write permission on the folder where you try to export java_cacerts.txt .
Upvotes: 0
Reputation: 8300
You likely don't have permission to write to your current working directory.
Firstly try creating the file java_cacerts.txt
without any keytool command, you should get the same error running something like touch java_cacerts.txt
Upvotes: 1