title: Unable to import certificate to cacerts
body: <p>My requirement is to import a certificate for maven repositories into the global keystore. </p>
  
  <p>The certificate file is named maven-cacert.cer .</p>
  
  <p>I am using following command from <code>C:\Program Files\Java\jdk1.6.0_20\bin\</code> from <code>cmd</code></p>
  
  <pre><code>keytool -importcert -trustcacerts -alias c:\maven-cacert.cer -file c:\maven-cacert.cer.der -keystore $JAVA_HOME\jre\lib\security\cacerts
  </code></pre>
  
  <p>as <code>maven-cacert.cer</code> file is in <code>C</code> directory</p>
  
  <p>after pressing enter it asked to put password and after giving password it is saying like </p>
  
  <pre><code>keytool error: java.io.FileNotFoundException: $JAVA_HOME\jre\lib\security\cacerts (The system cannot find the path specified
  </code></pre>
  
  <p>I also tried </p>
  
  <pre><code>   keytool -importcert -trustcacerts -alias c:\maven-cacert.cer -file c:\maven- cacert.cer.der -keystore \usr\java/jdk1.6.0_20/bin/java\jre\lib\security\cacerts
  </code></pre>
  
  <p>but getting same output</p>
  
  <p>Please help what is going wrong with my command while <code>cacerts</code> file is inside <code>$JAVA_HOME\jre\lib\security\</code> directory.</p>