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);
}
I don’t get any error, just nothing. In cmd.exe prog.exe is working fine.
What to improve in order to make this code working?
Perhaps you should use waitFor() to obtain the result code. This means that the dump of the standard output must be done in another thread: