--- old/src/jdk.jartool/share/classes/sun/tools/jar/Main.java 2016-10-11 11:00:23.000000000 -0700 +++ new/src/jdk.jartool/share/classes/sun/tools/jar/Main.java 2016-10-11 11:00:23.000000000 -0700 @@ -76,7 +76,7 @@ public class Main { String program; - PrintStream out, err; + PrintWriter out, err; String fname, mname, ename; String zname = ""; String rootjar = null; @@ -189,9 +189,9 @@ USAGE_SUMMARY(GNUStyleOptions::printUsageSummary), VERSION(GNUStyleOptions::printVersion); - private Consumer printFunction; - Info(Consumer f) { this.printFunction = f; } - void print(PrintStream out) { printFunction.accept(out); } + private Consumer printFunction; + Info(Consumer f) { this.printFunction = f; } + void print(PrintWriter out) { printFunction.accept(out); } }; Info info; @@ -252,6 +252,12 @@ } public Main(PrintStream out, PrintStream err, String program) { + this.out = new PrintWriter(out, true); + this.err = new PrintWriter(err, true); + this.program = program; + } + + public Main(PrintWriter out, PrintWriter err, String program) { this.out = out; this.err = err; this.program = program;