title: php shell_exec executing java program
body: <p>In PHP code I try to execute Java program using shell_exec but I get empty line.</p>
  
  <p>When I tried to execute program in bash:</p>
  
  <pre><code>#bin/bash
  
  echo "aaa"
  </code></pre>
  
  <p>I get "aaa" but when i tried to execute the same file with</p>
  
  <pre><code>#bin/bash
  
  java MainApp
  </code></pre>
  
  <p>I got empty line</p>
  
  <p>This is the java code</p>
  
  <pre><code>public class MainApp{
          public static void main(String[] args)
          {
                  System.out.print(":]");
          }
  }
  </code></pre>
  
  <p>When i do:</p>
  
  <pre><code>#bin/bash
  
  echo "aaa"
  java MainApp
  echo "bbb"
  </code></pre>
  
  <p>I get "aaa bbb"</p>
  
  <p>I wont to get ":]" string
  How to make it work?</p>
  
  <p>Maybe printing line with System.out.println(String ) is not the same as echo and printing line is not the same as returning value</p>