title: Not able to run specific terminal commands from java program(Eclipse)
body: <p>Using ProcessBuilder in JAVA I am able to run simple terminal commands like ls,pwd,echo etc..etc...
  But following code is getting terminated , don't know why??</p>
  
  <pre><code>public static void main(String[] args) throws Exception
  {
      Runtime r = Runtime.getRuntime();
      Process p = r.exec("echo 'T W O N E I G H T' | /home/saj/g2p/mosesdecoder-master/bin/moses -f /home/saj/g2p/working/binarised-model/moses.ini");
      p.waitFor();
  
      BufferedReader b = new BufferedReader(new InputStreamReader(p.getInputStream()));
      String line = "";
      while ((line = b.readLine()) != null) 
      {
        System.out.println(line);
      } 
  }
  </code></pre>
  
  <p>This command works perfectly from terminal and takes around 15 seconds to run and gives output.
  I have gone through similar topics on stackoverflow but did not found any help.
  Please help in this regard.
  Thanks in advance.</p>