I need to read the output of a process running on IBM j9 (emulator JVM to windows mobile). I tried this:
Process p = Runtime.getRuntime().exec("j9.exe");
BufferedReader br = new BufferedReader(new InputStreamReader(
p.getInputStream()));
String stringLog;
while ((stringLog = br.readLine()) != null) {
System.out.println(stringLog + "\n");
}
But it didn't work because it returned a new instance of j9.exe
, not the existing process.
I need to get all messages that are being logged to System.out from j9console (of the existing process). How would I go about doing that?