I want to be able to launch a Java server process from an existing java application and monitor the stdoutput and stderror and redirect that output to a file. Is the best approach to use 'Runtime.exec' and treat the app like any other OS process or is there something more suited for new JVMs.
This is on Java 1.5
Instead of Runtime
, you should probably use ProcessBuilder
, though I don't know if something else is even more appropriate in your case (running a Java process in particular).