// File, URL and URLClassLoader will be frequently used by scripts.
new NativeJavaPackage("java.net", loader),
new NativeJavaPackage("java.io", loader),
},
null);
Script scriptObject = cx.compileReader(scope, getScriptReader(), "javascript", 1, null);
scriptObject.exec(cx, scope);
Object pico = scope.get("pico", scope);
if (pico == null) {
throw new NanoContainerMarkupException("The script must define a variable named 'pico'");