Runnning JRuby from Java code w\o ScriptEngineManager

How can I run JRuby from Java; but WITHOUT going through
javax.script.ScriptEngineManager?
I would like to call JRuby main function or similar. For example:
jruby.[FooMainClass].eval(new BufferedReader(new
FileReader(“myrubyfile.rb”)));

thanks!

(BTW, example WITH ScriptEngineManager:
http://dior.ics.muni.cz/~makub/ruby/)

Roy -

There may be other ways to create and use a Scripting Container, but I
don’t think it’s possible to run JRuby code without one. The Java
interpreter just doesn’t know Ruby.

On the other hand, you could write Java code that would isolate that
complexity somewhere so that the call from Java would look and feel more
natural.

  • Keith

Keith R. Bennett
http://about.me/keithrbennett

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs