title: c:\Windows\System32\java.exe default cert store location?
body: <p>I have not set <code>java_home</code> and I need to know where the <code>c:\Windows\System32\java.exe</code> file points to.
  I have several JDKs and JREs on my system. </p>
  
  <p>The reason is that I am trying to connect via SSL to some server and it works in Netbeans after I export the certificate in the appropriate JRE (which I can see via Netbeans options)</p>
  
  <p>However, when I connect via command-line, I get an SSL error. I tried adding the certificate to all my JREs but I cannot get it to work. I think it is a problem that this Windows shortcut points to some place I overlooked.</p>
  
  <p>Is there an easy way to find out which JRE is the default one? </p>
  
  <p>[EDIT] Or rather I need to find the location of the default keystore in the default JRE.</p>
  
  <p>[EDIT] My problem is elaborated below:</p>
  
  <p>the following two give SSL error:</p>
  
  <pre><code>"c:\Program Files\Java\jre6\bin\java.exe" -cp myjar.jar mypackage.myclass 
  "c:\Program Files (x86)\Java\jre6\bin\java.exe" -cp myjar.jar mypackage.myclass 
  </code></pre>
  
  <p>The following two work</p>
  
  <pre><code>"c:\Program Files\Java\jdk1.6.0_24\bin\bin\java.exe" -cp myjar.jar mypackage.myclass 
  "c:\Program Files (x86)\jdk1.6.0_24\bin\jre6\bin\java.exe" -cp myjar.jar mypackage.myclass 
  </code></pre>
  
  <p>I have exported the certificate using all four commands: </p>
  
  <pre><code>"c:\Program Files\Java\jdk1.6.0_24\bin\bin\keytool.exe" -import -alias myalias -file mycertfile
  "c:\Program Files (x86)\Java\jdk1.6.0_24\bin\bin\keytool.exe" -import -alias myalias -file mycertfile
  "c:\Program Files\Java\jre6\bin\bin\keytool.exe" -import -alias myalias -file mycertfile
  "c:\Program Files (x86)\Java\jre6\bin\bin\keytool.exe" -import -alias myalias -file mycertfile
  </code></pre>
  
  <p>So it seems that the keytool uses a different store than <code>java.exe</code>. </p>
  
  <p>would appreciate some help on this. </p>