Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-21-2008, 09:31 PM
Sixtease's Avatar
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-21-2008, 11:02 PM
roots's Avatar
Moderator
 
Join Date: Jan 2008
Location: Dallas
Posts: 263
roots is on a distinguished road
Does System.setOut(System.err) helps any way ..
__________________
dont worry newbie, we got you covered.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-22-2008, 10:59 AM
Sixtease's Avatar
Member
 
Join Date: Mar 2008
Location: Breclav, Czech Republic
Posts: 2
Sixtease is on a distinguished road
Quote:
Originally Posted by roots View Post
Does System.setOut(System.err) helps any way ..
It very well does. :-) Thanks a lot.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to redirect the output Java Tip java.io 0 04-04-2008 03:36 PM
JSP redirection script ravian New To Java 1 01-07-2008 11:33 AM
output Camden New To Java 3 12-01-2007 11:34 PM
redirection in jsp valery JavaServer Pages (JSP) and JSTL 1 08-06-2007 09:31 PM
stream redirection Ed New To Java 1 07-02-2007 05:34 PM


All times are GMT +3. The time now is 01:07 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org