I am running a c++ program (makefile) as a background process using Processbuilder from my java Program. I am capturing the values displayed in my cmd prompt using .getInputStream and displaying in my console (IDE) .
input = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
try {
while((line=input.readLine()) != null) {
System.out.println(line);
This works well. Suppose if i make some error in one of my c++ file and when i try to run the makefile it is not capturing the error message. On using "cmd.exe","start" i can view the error in cmd prompt but it is not displayed in the console(IDE) .
May i know what i should do to get the error message displayed.
1) System.err and printstream could be the solution for this ? if it so could you be please show me a sample piece of code. Thanks in advance