title: Executing in java code an external program that takes arguments
body: <pre class="lang-java prettyprint-override"><code>Process p;
  String line;
  String path;
  String[] params = new String [3];
  
  params[0] = "D:\\prog.exe";
  params[1] = picA+".jpg";
  params[2] = picB+".jpg";
  
  try
  {
      p = Runtime.getRuntime().exec(params);
  
      BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
  
      while ((line = input.readLine()) != null)
          System.out.println(line);
  
      input.close();
  }
  catch (IOException e)
  {
      System.out.println(" procccess not read"+e);
  }
  </code></pre>
  
  <p>I don't get any error, just nothing. In cmd.exe prog.exe is working fine.</p>
  
  <p>What to improve in order to make this code working?</p>