Search code examples
javarubyjruby

Does running JRuby codes in Java need a JRuby installation?


When running a Ruby script in Java we use ScriptEngine jruby = new ScriptEngineManager().getEngineByName("jruby"); and it seems that there's no need to install JRuby if you only need to call Ruby script from Java.
I'm using jdk8.0.
I'm not sure whether I am thinking of this staff in the right way...


Solution

  • You don't need an "install" of JRuby (as in the tar.gz or zip expanded somewhere on your system) but you will need to have one of the JRuby jar files somewhere in your application's CLASSPATH. I would recommend the jruby-complete.jar, which contains the Ruby standard library.