I want to save the stdout into a file. For this, I used
System.setOut(new PrintStream(new File("output-file.txt")));
Now, there is no output in the console.
try {
System.setOut(new PrintStream(new File("output-file.txt")));
} catch (Exception e) {
e.printStackTrace();
}
Is there any possibility to show the stdout in the console, although I use stdout to fill a file?