Cannot load JRubyEngine because org.apache.bsf.util.BSFEngineImpl not found

Posted by Ceilingfish on Stack Overflow See other posts from Stack Overflow or by Ceilingfish
Published on 2010-03-17T16:48:21Z Indexed on 2010/03/17 16:51 UTC
Read the original article Hit count: 380

Filed under:
|
|

Hi, I'm trying to use JRuby in a custom application, and I don't seem to be able to load the JRubyEngine object. My class looks like functionally similar to this:

public class ScriptEngine {

    private static ScriptEngine engine = new JRubyEngine();

    public void run(final String script, final Map<String,Object> input) {
        final Bindings context = engine.createBindings();

        context.putAll(input);

        try {
            engine.eval(script,context);
        } catch (ScriptException e) {
            log.error("Failed to execute script: "+getScript(),e);
        }
    }

}

However this fails at compilation with the complaint:

[javac] Compiling 486 source files to /workspace/myProject/build/src
[javac] /workspace/myProject/src/net/ceilingfish/ScriptEngine.java:31: cannot access org.apache.bsf.util.BSFEngineImpl
[javac] class file for org.apache.bsf.util.BSFEngineImpl not found
[javac]     private static ScriptEngine engine = new JRubyEngine();
[javac]                                          ^
[javac] 1 error

Does anyone have any insights on where I can get this class from? Or if there is a better way to be instantiating a JRubyEngine object.

© Stack Overflow or respective owner

Related posts about java

Related posts about jruby