I compiled a Java program as
javac t1.java > a
to redirect error messages to file a . But a does not contain the contents of the error (they are still displayed in the terminal). The command is executed from the Linux command line.
The contents of t1.java is:
class t1 { public static void main(String[] args) { System.out.printn("Hello World!");
So now there is an error, i.e. println written as printn .
How can I capture this error message in file a ?
source share