How to run a .jar file from inside another java program?
<p>i have a .jar file, which I can run on the command line:</p>

<pre><code>java -jar myFile.jar argument1
</code></pre>

<p>I want to save the output of this .jar as a String variable inside another java program.</p>

<p>How can I do it?</p>

<p>I tried including myFile.jar as a reference in my program, and doing <code>myFile.main(new String{"argument1"})</code> in my program. But this just prints the results to console, I can't use the results in my program.</p>

<p>Hope this is not too confusing.</p>
