title: PHP run a java program and get the output
body: <p>I have PHP that I am running with ajax. What I want to happen is the php executes a java program returns the output of said java program. Right now in my PHP file, as a test I am trying</p>
  
  <pre><code>exec("java -version", $output);
  print_r($output);
  </code></pre>
  
  <p>However, this just prints to the console </p>
  
  <pre><code>Array
  (
  )
  </code></pre>
  
  <p>Also, when I add in my actual java program, it is outputting using System.out.println() if that makes a difference as to how it is read by PHP.</p>