如何将控制台消息从 Eclipse 写入文件?
请查看它,如果有人提供解决方案,我将不胜感激。我的示例程序如下
这是控制台消息:
Invalid Excel Path Specified "+path
try {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String lineFromInput = in.readLine();
PrintStream out = new PrintStream(new FileOutputStream("C:/Error.txt"));
System.setOut(out);
out.close();
}
catch(IOException e1) {
System.out.println("Error during reading/writing");
}
}