Java, inherit classpath with Runtime.exec()
<p>I have a program that will create a child process, and I want it inherit all the classpath from its parent. In javadoc, it says:</p>

<blockquote>
  <p>public Process exec(String[] cmdarray,
                          String[] envp)
                   throws IOException</p>
  
  <p>Executes the specified command and arguments in a separate process with the specified environment.</p>
  
  <p>Given an array of strings cmdarray, representing the tokens of a command line, and an array of strings envp, representing "environment" variable settings, this method creates a new process in which to execute the specified command.</p>
  
  <p><em><strong>If envp is null, the subprocess inherits the environment settings of the current process.</em></strong>  </p>
</blockquote>

<p>When I set envp to null, it didn't inherit anything.</p>

<p>Here is the code:</p>

<pre><code>System.out.print("Debug system path: "+System.getProperty("java.class.path"));
            startTime();
Process proc = Runtime.getRuntime().exec(cmd,null);
</code></pre>

<p>I can see the path information, but these path information is not inherited by the new created process.</p>
