if (eng == null) {
throw new IllegalStateException("Failed to instantiate the 'rhino-nonjdk' script engine. This means that either the required library is missing from the classpath or that there are some security issues preventing it from being instantiated.");
}
for (String pkg : packages) {
eng.eval("importPackage(" + pkg + ")");
}
return eng;
}
}