Scriptify is a JVM library for embedding JavaScript execution into Java applications. It provides script runtimes, Java function exports, constants, modules, host-access control, and security-aware file access.
This documentation is organized by feature. Start with installation and runtime selection, then move to the API areas you need.
| Page | Topic |
|---|---|
| Installation | Gradle/Maven coordinates and module artifacts. |
| Runtime Selection | GraalVM vs Rhino behavior and tradeoffs. |
| Script Lifecycle | evalOneShot, compile, CompiledScript, addExtraScript. |
| Functions | Custom Java functions, annotations, argument binding, managers. |
| Constants | Global constants and module constant exports. |
| Modules | Internal modules, exports, global module, import support. |
| External Modules | File and stream modules, GraalVM/Rhino differences. |
| ScriptAccess | ALL, EXPLICIT, and @ScriptAccess.Export. |
| Security | Class/path restrictions, security mode, safe exposure patterns. |
| Standard Module | Utility, file, crypto, random, OS, and zip functions. |
| HTTP Module | HttpScriptModule, HttpRequest, methods, output types. |
| Custom Runtime | Implementing another engine behind Scriptify APIs. |
| Exceptions | Error model and exception types. |
| Limitations | Runtime differences, deprecated APIs, known constraints. |
import org.densy.scriptify.js.graalvm.script.JsScript;
JsScript script = new JsScript();
Object result = script.evalOneShot("1 + 2 + 3");For Rhino, use org.densy.scriptify.js.rhino.script.JsScript.
Use modules for new integrations:
SimpleScriptInternalModule module = new SimpleScriptInternalModule("app");
module.export(new ScriptValueExport("version", "1.0.0"));
script.getModuleManager().addModule(module);import { version } from "app";
version;Global function and constant managers still exist, but module exports are easier to reason about and are the preferred surface for application APIs.