Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
/**
* Method redirect stdout and stderr to specified directory.
*/
public static void redirect(File directory) {
try {
File tempFile = File.createTempFile("stderr", "", directory);
System.setErr(new PrintStream(new FileOutputStream(tempFile)));
tempFile = File.createTempFile("stdout","", directory);
System.setOut(new PrintStream(new FileOutputStream(tempFile)));
}
catch (Throwable t) {
System.err.println(
"Error overriding standard output to file.");
t.printStackTrace(System.err);
}
}
redirect(new File("D:\\java\\Temp"));