The docs currently tell users to create a ScriptEngine instance this way:
ScriptEngineManager manager = new ScriptEngineManager();
// create a Renjin engine:
ScriptEngine engine = manager.getEngineByName("Renjin");
// check if the engine has loaded correctly:
if(engine == null) {
throw new RuntimeException("Renjin Script Engine not found on the classpath.");
}
Unfortunately, in the event of an error, the javax.scripting API will throw away all information about the error and leave us only with a null.
In place of this, the user can invoke RenjinScriptEngineFactory directly:
RenjinScriptEngine engine = new RenjinScriptEngineFactory().getScriptEngine();
This will preserve the stack trace and details about any problem that occurs.
We can still mention the getEngineByName("Renjin") method for those who are working with multiple script engines, for example, but for most users, instantiating it directly will be more helpful.
The docs currently tell users to create a ScriptEngine instance this way:
Unfortunately, in the event of an error, the javax.scripting API will throw away all information about the error and leave us only with a null.
In place of this, the user can invoke RenjinScriptEngineFactory directly:
This will preserve the stack trace and details about any problem that occurs.
We can still mention the
getEngineByName("Renjin")
method for those who are working with multiple script engines, for example, but for most users, instantiating it directly will be more helpful.