I have run an external tool through exce() function in a separate command line console.
command = "cmd.exe /c start /min doxygen " + strDoxyfilePath;
System.out.println("command : " + command);
//pass the command to execute
Process p=Runtime.getRuntime().exec(command);
I used this for read input stream:
BufferedReader br = new BufferedReader(new InputStreamReader
(p.getInputStream(), "UTF-8")); //read output of doxygen
String line = null;
while ((line = br.readLine()) != null){
System.out.println("I M HERE: "+line);
}
But control doesn’t go inside while loop and I want to get proper signal at the process end.
I think it is because of the
startin your command. You are probably doing it to avoid a cmd window but I think you cannot not interact with the program then.Try
Also, note that
p.getErrrorStream())Runtime.execis not a great way to start a child process.ProcessBuilderis the newer and better way to do it.