title: Redirecting Jruby ScriptEngine output to a StringWriter
body: <p>I recently encountered a strange problem when trying to redirect the ScriptEngine output for my ruby session.  It seems that no matter what Ipass in to my ScriptEngine, it always prints to stdout and stderr.  I found this post, but it says it's fixed.  </p>
  
  <p><a href="https://scripting.dev.java.net/issues/show_bug.cgi?id=8" rel="nofollow">https://scripting.dev.java.net/issues/show_bug.cgi?id=8</a></p>
  
  <pre><code>scriptContext.setWriter(outWriter);
  scriptContext.setErrorWriter(errWriter);
  
  ruby.setContext(scriptContext);
  ruby.eval(...)
  </code></pre>
  
  <p>I'm running through sbt and using the latest version of the jruby-complete.jar, yet it still goes to stdout every time.  Has this issue truly been resolved?</p>
  
  <p>I've also trying passing <code>eval(...)</code> a StringWriter, but I get an array exception when I try to pull a string out afterwards.  </p>