|
Output Redirection
Hello all I'm new here and would like to ask for your advice.
I'm writing a Perl application that embeds a Java program. (I'm using Inline::Java for those interested in Perl). The interaction works so that the Perl process communicates with JVM via a socket, I have access to public methods of classes of my choice and can define my own classes. I can also set up parameters for java and javac.
So, I'm running this class' main method and it happens to write to STDOUT. But I want the output to go into STDERR. Setting up redirection in Perl doesn't help as Java runs in a separate process and keeps its own track of filehandles.
So my question is: Can I redirect the output from STDOUT to STDERR for a Java program using either parameters to JVM or running my own Java code? I can't modify the Java class that gives the output.
|