The following test:
public void testJRubyExitBehaviour() throws Exception
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByExtension("rb");
catch (ScriptException e)
The test itself does actually pass, but what's bad here is that it logs the following to stderr:
exit at org/jruby/RubyKernel.java:867
exit at org/jruby/RubyKernel.java:836
(root) at <script>:1
org.jruby.embed.EvalFailedException: (SystemExit) exit
...26 lines elided...
Caused by: org.jruby.exceptions.RaiseException: (SystemExit) exit
This makes it difficult if you're trying to write a command-line application which wants to display a nice usage message to the user and then exit - they can't read the usage message because they get a page full of errors after it.
The main jruby runtime itself doesn't appear to do this with the same kind of script, so I figure the error is limited to when you're embedding.