开发者

redirect and get the output of console of eclipse to string or output text java

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


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");
  }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜