.lang.NoSuchMethodError: org.jruby.Ruby.newInstance()

I am trying to JSR223 to call ruby method from java.
My Jruby version is 0.9.8. My Java Version 6.

Here is my Code
import javax.script.;
import java.util.
;

public class EvalScript {
public static void main(String[] args) throws Exception {
ScriptEngineManager mgr = new ScriptEngineManager();
// Create a JRuby engine.
ScriptEngine engine = mgr.getEngineByName(“jruby”);
// Evaluate JRuby code from string.
try {
engine.eval(“puts(‘Hello’)”);
} catch (ScriptException exception) {
exception.printStackTrace();
}
}
}

When I try to run this application, I am getting the following error:
Exception in thread “main” java.lang.NoSuchMethodError:
org.jruby.Ruby.newInstance()Lorg/jruby/Ruby;
at
com.sun.script.jruby.JRubyScriptEngine.init(JRubyScriptEngine.java:475)
at
com.sun.script.jruby.JRubyScriptEngine.(JRubyScriptEngine.java:96)
at
com.sun.script.jruby.JRubyScriptEngineFactory.getScriptEngine(JRubyScriptEngineFactory.java:134)
at javax.script.ScriptEngineManager.getEngineByName(Unknown
Source)
at EvalScript.main(EvalScript.java:27)

please help me to resolve this issue.

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