title: How to launch 64 bit version of javaw.exe from CreateProcess (C++)
body: <p>I am writing a launcher in C++ to launch my java based GUI application on Windows. I am using <code>CreateProcess</code> to launch "javaw.exe". Everything works except for the fact that 32-bit version of "javaw.exe" is always launched.</p>
  
  <p>When java is installed, it puts the executables "java.exe" and "javaw.exe" in <code>%windir%\System32</code> on 32-bit windows. On 64-bit windows, it puts the same executables in <code>%windir%\SysWow64</code>.</p>
  
  <p>There are 3 possibilities:</p>
  
  <ol>
  <li><p>32-bit launcher executed on 32-bit windows: <code>%windir%\System32</code> is in search path, and 32-bit javaw.exe is found. The GUI launches. Everything works.</p></li>
  <li><p>32-bit launcher executed on 64-bit windows: <code>%windir%\System32</code> is in search path. <code>%windir%\System32</code> is redirected to <code>%windir%\SysWow64</code> (since my launcher is 32 bit in this case). 32-bit javaw.exe is found. The GUI launches. Everything works.</p></li>
  <li><p>64-bit launcher executed on 64-bit windows: <code>%windir%\System32</code> is in search path. No redirection happens. It does not contain the executable javaw.exe. The launcher fails.</p></li>
  </ol>
  
  <p>How do I launch 64-bit javaw.exe in the third case?</p>