title: Node: child_process.spawn not working on Java even though it's in the path (ENOENT)
body: <p>I was debugging WebDriverJs in Windows today, and ran into an error that I traced down to spawning Java:</p>
  
  <pre><code>var spawn = require('child_process').spawn;
  spawn('java');
  </code></pre>
  
  <p>The end error is as follows:</p>
  
  <pre><code>Error: spawn ENOENT
      at errnoException (child_process.js:980:11)
      at Process.ChildProcess._handle.onexit (child_process.js:771:34)
  </code></pre>
  
  <p>java.exe is in C:\Windows\System32\, and C:\Windows\System32 is in path (and the path in Node correctly includes it). Trying the full path to Java didn't seem to work either.</p>
  
  <p>What's going on? <code>spawn('node')</code>, as a counter-example, doesn't fail. Java prints out something when I type it from the command line.</p>