View Single Post
  #1 (permalink)  
Old 03-21-2008, 10:31 PM
Sixtease's Avatar
Sixtease Sixtease is offline
Member
 
Join Date: Mar 2008
Location: Breclav, Czech Republic
Posts: 2
Sixtease is on a distinguished road
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.
Reply With Quote
Sponsored Links