title: Access denied when creating keystore for Android app
body: <p>I am trying to sign my Android app so I can release it in Market. When I generate the keystore, I get an access denied error. How do I fix this?</p>
  
  <p><img src="https://i.stack.imgur.com/c1PUb.png" alt="android keystore selection"></p>
  
  <p>This is what I've been trying to do:</p>
  
  <ol>
  <li>Right click project in Eclipse Helios.</li>
  <li>Android Tools > Export Signed Application Package.</li>
  <li>Click next.</li>
  <li>I check "Create new keystore" and realize it does nothing to help me. It still asks for the location of keystore. So I decide to do it the hard way.</li>
  <li>Turned off read-only access on <code>C:\Program Files\Java\jdk1.6.0_25\bin</code> and granted the <code>CREATOR OWNER</code> group full control of the folder.</li>
  <li>Open command line on Windows 7 64-bit.</li>
  <li>Traverse to <code>C:\Program Files\Java\jdk1.6.0_25\bin</code>.</li>
  <li>Run keytool.</li>
  <li>Got an access denied error.</li>
  </ol>
  
  <p>.</p>
  
  <pre><code>C:\Program Files\Java\jdk1.6.0_25\bin&gt;keytool -genkey -v -alias company -keyalg R
  SA -keysize 2048 -validity 10000 -keystore company.keystore
  Enter keystore password:
  Re-enter new password:
  What is your first and last name?
    [Unknown]:  John Smith
  What is the name of your organizational unit?
    [Unknown]:  Android
  What is the name of your organization?
    [Unknown]:  Company
  What is the name of your City or Locality?
    [Unknown]:  Albany
  What is the name of your State or Province?
    [Unknown]:  NY
  What is the two-letter country code for this unit?
    [Unknown]:  US
  Is CN=John Smith, OU=Android, O=Company, L=Albany, ST=NY, C=US correct?
    [no]:  yes
  
  Generating 2,048 bit RSA key pair and self-signed certificate (SHA1withRSA) with
   a validity of 10,000 days
          for: CN=John Smith, OU=Android, O=Company, L=Albany, ST=NY, C=US
  Enter key password for &lt;veetle&gt;
          (RETURN if same as keystore password):
  Re-enter new password:
  [Storing company.keystore]
  keytool error: java.io.FileNotFoundException: veetle.keystore (Access is denied)
  
  java.io.FileNotFoundException: veetle.keystore (Access is denied)
          at java.io.FileOutputStream.open(Native Method)
          at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:194)
          at java.io.FileOutputStream.&lt;init&gt;(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)
  </code></pre>
  
  <h1>Edit:</h1>
  
  <p>Everytime I check the folder permissions, I see that it has reverted back to read-only. There were no errors whenever I turned off read-only.</p>