views:

28

answers:

1

i tired to redirect the output of eclipse to an output text , the principale idea is to get the output of eclipse console , th result is the maven description,
i want to redirect the output such as hudson console in an output text

A: 
public class RedirectTest {
  public static void main(String[] args) throws IOException {
    PrintStream ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(new File("output.txt"))), true);
    System.setOut(ps);
    System.out.println("test");
  }
}
Antoras