Process not found when running from getRuntime.exec() from the JVM
<p>I am trying to run the following code from within Eclipse:</p>

<pre><code>Process process = Runtime.getRuntime().exec("gs");
</code></pre>

<p>However I get the exception:</p>

<blockquote>
  <p>java.io.IOException: Cannot run
  program "gs": error=2, No such file or
  directory</p>
</blockquote>

<p>Running gs from the command prompt (OS X) works fine from any directory as it is on my PATH.  It seems eclipse doesn't know about my path environment variable, even though I have gone into run configurations and selected PATH on the environment tab.</p>

<p>In additional effort to debug this issue I tried the following code:</p>

<pre><code>Process process = Runtime.getRuntime().exec("echo $PATH");
InputStream fromStdout = process.getInputStream();
byte[] byteArray = IOUtils.toByteArray(fromStdout);
System.out.println(new String(byteArray));
</code></pre>

<p>The output was $PATH, hmm.  Can someone nudge me in the correct direction?</p>
