What Is GraalVM JavaScript Scripting? (2026)

GraalVM JavaScript is a fast JS engine that runs on the JVM. Apps embed it so users can script in JavaScript and hot-reload it without recompiling Java.

Conceptsby trqUpdated June 4, 2026
Key takeaways
  • GraalVM JavaScript is a fast, standards-compliant JS engine that runs on the JVM.
  • Java apps embed it so users can write JavaScript that calls into the host program.
  • Scripts hot-reload, so you change behavior without recompiling the Java code.
  • The host decides exactly which objects and classes a script can touch.

GraalVM JavaScript is a fast, standards-compliant JavaScript engine that runs on the JVM, part of the GraalVM project. Java applications embed it so users can write JavaScript that calls into the host program and reloads on the fly. In a Java application, that means adding or changing behavior in JavaScript without recompiling the Java code.

Where Opal fits

Opal's scripting engine runs on GraalVM JavaScript. To start writing scripts, see the scripting guide.

GraalVM and GraalVM JavaScript

GraalVM is a high-performance runtime that can run several languages on the JVM. Its JavaScript engine is modern enough to support recent ECMAScript features. An app ships the engine, hands scripts a set of objects to work with, and runs them.

Why apps embed it

  • Hot reload: change a script and see the effect without restarting or rebuilding.
  • A safe surface: the host decides exactly which objects and Java classes a script can touch.
  • Java interop: scripts can call into the application's own code through the objects it exposes.

How it shows up in a client

A program that embeds the engine usually gives scripts an entry point to register themselves, then a small set of "proxy" objects that bridge JavaScript to the program's internals. Users write a script, drop it in a scripts folder, and the engine loads it. This is how a client can let users add features in JavaScript instead of compiling a mod.

FAQ