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
-bash: java_cacerts.txt: Permission denied
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