Given this code, I am baffled as to why it doesn’t print to the console….
engine.compileTemplate(new PrintWriter(System.err));
System.err.flush();
I see nothing on the console. Same problem with System.out too. And yes I verified that the code works by printing to a file successfully.
Try using the constructor with autoflush. You are flushing System.err, not the PrintWriter.