Fix terminal output on JRuby