Environment variables passed by Runtime.exec(String)
<p>Are the environment variables of the parent process(e.g. shell) available in the environment in which a child process that is invoked using Runtime.exec(command) run? I had a look at the API documentation but it's not specified there. </p>

<p>My use case is this</p>

<p><code>mainScript.sh</code> invokes <code>java MainClass</code></p>

<p><code>MainClass</code> invokes <code>Runtime.exec("hi.sh")</code></p>

<p>Now, is a variable <code>MY_ENV</code> that is set and exported in <code>mainScript.sh</code> available to <code>hi.sh</code>?</p>

<p>PS: I'm aware of the 2nd API that takes explicit <code>String[] envp</code>.</p>

<p><a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4064912" rel="nofollow">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4064912</a> has some vague info.</p>
