Yahwho :
I have a JVM(1) which launches JVM(2). I want to be able to monitor the System.out.println() calls from JVM(2) in JVM(1).
GhostCat salutes Monica C. :
The straight forward way would be:
- JVM A does a system command to start JVM B
- JVM A then reads all output from B
See here for how to do that (in essence, there is no difference between calling java SomeClass
... or any other command that then writes to stdout/stderr).
If your two JVMs get started independently, then the only option left would be that the "start command" of B redirects all output into a file. And then, depending on the OS, you can only hope that the other JVM sees all updates to that file in a timely manner.