title: Permission error when importing certificate to cacerts
body: <p>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 </p>
  
  <pre><code>keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -alias maven -file maven.crt
  </code></pre>
  
  <p>It asks me for password and then if I trust the certificate to which I answer yes
  This is the final output </p>
  
  <pre><code>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)
  </code></pre>
  
  <p>I ran this command as root so I don't know why I am receiving permissions error here.</p>