On May 4, 3:24?pm, Andreas Leitgeb <a...@gamma.logic.tuwien.ac.at>
wrote:
If the applications do not really cooperate, then you're probably
better off, starting another virtual machine per Runtime.exec().
Reading all your responses I realised that I'm facing a greater
problem than I excpected. The first, I don't want my subprogram, which
hapens to invoke the exit() function in some cases, to stop the entire
application (the "superprogram" ;) ). The second, there are multiple
threads in both the subprogram and superprogram, and I'd like to
intercept or suppress messages being printed on error and output
streams by the subprogram, while messages originating from all the
other threads of the superprogram should be visible. How to do it?
After reading the documentation and Internet resources, I came to
conclusion that I should use Runtime.exec() and then
Process.getInputStream() to capture the output stream! (the output of
the subprogram is the input of the superprogram).
Is it really the only possible solution? I would prefer not to invoke
my subprogram as an external application, but rather just like a
method.
MR
System.out/.err. If your "sub-program" is running within the same JVM as the
output. If your sub-program uses a Logger for output then you should be able to
control that quite adequately.