explicitly using $stdout to handle jruby