Ant redirecting stdout to a file while in a spawned java program

Discussion in 'Java' started by Douwe, Jan 9, 2004.

  1. Douwe

    Douwe Guest

    Hi,

    I created a build.xml file that starts a spawned java application. The
    program starts fine and the ant terminates nicely as expected.
    Unfortunately this program can (just like any other program) produce
    errors on the console and Ant does not allow you to redirect the
    standard output (stdout) while spawning a proces.

    I´ve browsed the Ant source code and ended read the Java API of the
    Process class (since this is indirectly called by the ant task <java>.
    This API reports that the process knows three methods called:
    Process.getOutputStream(), Process.getInputStream(),
    Process.getErrorStream().

    Is their somehow a workaround to set the stdout in a new process
    without altering my program?

    Thnx
     
    Douwe, Jan 9, 2004
    #1
    1. Advertising

  2. "Douwe" <> wrote in message
    news:...
    > Hi,
    >
    > I created a build.xml file that starts a spawned java application. The
    > program starts fine and the ant terminates nicely as expected.
    > Unfortunately this program can (just like any other program) produce
    > errors on the console and Ant does not allow you to redirect the
    > standard output (stdout) while spawning a proces.


    Yes, it does. Look at the error and output argument to the java task.

    http://ant.apache.org/manual/CoreTasks/java.html
     
    Mike Schilling, Jan 12, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sudsy
    Replies:
    0
    Views:
    4,395
    Sudsy
    Jul 18, 2003
  2. Elad
    Replies:
    0
    Views:
    420
  3. SamG
    Replies:
    10
    Views:
    431
  4. =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z

    Issue of redirecting the stdout to both file and screen

    =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z, May 28, 2007, in forum: Python
    Replies:
    5
    Views:
    383
    =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z
    May 29, 2007
  5. subrahmanya
    Replies:
    1
    Views:
    456
Loading...

Share This Page