🌐
GraalVM
graalvm.org › javascript
JavaScript - GraalJS
import org.graalvm.polyglot.Context; try (Context context = Context.create()) { context.eval("js", "console.log('Hello from GraalJS!')"); }
Download
GraalVM is an advanced JDK with ahead-of-time Native Image compilation.
Community
GraalVM is an advanced JDK with ahead-of-time Native Image compilation.
Docs
GraalVM is an advanced JDK with ahead-of-time Native Image compilation.
Download GraalVM
GraalVM is an advanced JDK with ahead-of-time Native Image compilation.
🌐
GraalVM
graalvm.org › latest › reference-manual › js
GraalJS
Use artifactId js-community instead of js if you want to use GraalJS built on GraalVM Community Edition. Go step-by-step to create a Maven project, embedding JavaScript in Java, and run it. This example application was tested with GraalVM for JDK 25 and the GraalVM Polyglot API version 25.1.3.
🌐
GraalVM
graalvm.org › latest › reference-manual › js › RunOnJDK
Run GraalJS on a Stock JDK
We provide example projects running GraalJS embedded in Java on JDK 21 (or later) and using the Graal compiler: Polyglot Embedding Demo. Maven and Gradle projects for a simple JavaScript “Hello World” application.
🌐
GitHub
github.com › oracle › graaljs
GitHub - oracle/graaljs: GraalJS – A high-performance, ECMAScript compliant, and embeddable JavaScript runtime for Java
Also, the GraalVM Community Edition version has -community in the name, for example, graaljs-community-<version>-<os>-<arch>.tar.gz. Four different configurations are available for each component and platform combination: ... To install GraalJS from a standalone, download and extract the archive from the GitHub Releases page. After the installation, the js or node executable in the bin subdirectory can be used to run JavaScript ...
Starred by 2K users
Forked by 210 users
Languages   C++ 29.2% | C 23.9% | Perl 14.9% | Assembly 14.9% | JavaScript 11.4% | Java 3.2%
🌐
GraalVM
graalvm.org › 22.1 › reference-manual › js
GraalVM JavaScript Implementation
The source code unit can be represented with a String, as in the example, a file, read from URL, and other means. ... This way you can evaluate JavaScript context embedded in Java, but you will not be able to call a function and set parameters ...
🌐
GitHub
github.com › graalvm › graal-js-jdk11-maven-demo
GitHub - graalvm/graal-js-jdk11-maven-demo: An example project how to run Graal/JavaScript on JDK 11 with Graal as optimizing JIT compiler for best performance. · GitHub
May 22, 2024 - An example project how to run Graal/JavaScript on JDK 11 with Graal as optimizing JIT compiler for best performance. - graalvm/graal-js-jdk11-maven-demo
Starred by 179 users
Forked by 60 users
Languages   Java 91.1% | Jsonnet 8.9%
🌐
GraalVM
graalvm.org › 22.0 › reference-manual › js
JavaScript and Node.js
The source code unit can be represented with a String, as in the example, a file, read from URL, and other means. ... This way you can evaluate JavaScript context embedded in Java, but you will not be able to call a function and set parameters ...
🌐
GraalVM
graalvm.org › latest › reference-manual › js › Modules
Using JavaScript Modules and Packages in GraalJS
Therefore, any ECMAScript module should have file name extension .mjs. Alternatively, the module Source should have MIME type "application/javascript+module". As an example, let’s assume that you have a file named foo.mjs containing the following simple ES module:
🌐
Oracle
docs.oracle.com › en › graalvm › enterprise › 20 › docs › reference-manual › js › RunOnJDK
Run GraalVM JavaScript on a Stock JDK
January 16, 2025 - GraalVM JavaScript is open source and regularly pushed to Maven Central Repository by the community. You can find it as package org.graalvm.js. There is an example Maven project for GraalVM JavaScript on JDK11 (or later) using the GraalVM compiler at graal-js-jdk11-maven-demo.
Find elsewhere
🌐
GraalVM
graalvm.org › 22.1 › reference-manual › js › JavaInteroperability
JavaScript-to-Java interoperability
Java code can access such objects like normal Value objects, with the possibility to register new promise resolution functions using the Promise’s default then() and catch() functions. As an example, the following Java code registers a Java callback to be executed when a JavaScript promise resolves:
🌐
GraalVM
graalvm.org › jdk21 › reference-manual › js
GraalVM JavaScript and Node.js Runtime
It enables the Oracle GraalVM JavaScript runtime by default. Use js-community if you need the artifact built on top of GraalVM Community Edition. To access Java from JavaScript, use Java.type, as in the following example:
🌐
GraalVM
graalvm.org › 22.0 › reference-manual › js › Modules
Using JavaScript Modules and Packages
GraalVM JavaScript loads ECMAScript modules based on their file extension. Therefore, any ECMAScript module should have file name extension .mjs. Alternatively, the module Source should have Mime type "application/javascript+module". As an example, let’s assume that you have a file named foo.mjs containing the following simple ES module:
🌐
GraalVM
graalvm.org › 22.1 › reference-manual › js › Modules
Using JavaScript Modules and Packages in ...
GraalVM JavaScript loads ECMAScript modules based on their file extension. Therefore, any ECMAScript module should have file name extension .mjs. Alternatively, the module Source should have Mime type "application/javascript+module". As an example, let’s assume that you have a file named foo.mjs containing the following simple ES module:
🌐
Medium
medium.com › graalvm › asynchronous-polyglot-programming-in-graalvm-javascript-and-java-2c62eb02acf0
Asynchronous polyglot programming with Java and JavaScript on GraalVM | by Daniele Bonetta | graalvm | Medium
July 9, 2020 - At runtime, GraalVM will delegate ... this means that the JavaScript promise will either resolve or reject the interopPromise object depending on the result of the Java computeSomething() method call....
🌐
Lambdaschmiede
lambdaschmiede.com › en › blog › 2023-09-10 › invoking-javascript-from-graal-vm-using-java
Invoking Javascript from GraalVM using Java
October 17, 2023 - The following example uses GraalVM Community Edition version 20.0.2; it should be set up as the JVM in the context (IDE or $PATH). Since the runtime environment for JavaScript is not installed by default, it must first be installed using the GraalVM Updater: