title: php exec java error java not found
body: <p>Everybody who can use a command php <code>exec</code> to run a java. I have a problem on my coding to testing java.</p>
  
  <pre><code>$output = exec("java -version 2&gt;&amp;1");
  echo $output;
  </code></pre>
  
  <p>When I run a script on web browser I found, </p>
  
  <blockquote>
    <p>java: not found</p>
  </blockquote>
  
  <p>How can I work with php exec java.
  P.S. I could run a command <code>php java -version</code> on a shell command.</p>
  
  <p>Thanks in advance.</p>