Tech 8 min read

Oracle proposes ``Project Detroit'' to OpenJDK to fully incorporate V8 and CPython into Java

IkesanContents

Oracle announced Project Detroit at JavaOne 2026 (Redwood City, California, March 17) and submitted it as a project proposal to OpenJDK. The idea is to embed V8 (Google’s JavaScript engine) and CPython (Python’s reference implementation) directly into the Java build process and make them callable from the javax.script API.

When you hear “putting JavaScript on Java,” you might think it’s the opposite. However, the reason behind this is that multilingual integration on the Java side has been in limbo for nearly 10 years.

Third attempt at Java multilingual integration

The mechanism by which Java works with other languages has failed twice in the past. Project Detroit is my third attempt.

Nashorn era (reimplementing JavaScript on JVM)

Nashorn, introduced in Java 8 (2014), was a scripting engine that ran JavaScript on the JVM. It was introduced as a replacement for the earlier Rhino engine and allowed JavaScript to be called from Java code through the javax.script API.

The problem was the rate of evolution of ECMAScript. Since ES2015, the JavaScript specification has been updated every year, and new features such as async/await, modules, WeakRef, Proxy, and generators have been added one after another. Nashorn had to keep reimplementing it from scratch on the JVM. It was unrealistic for Oracle alone to keep up with the features of engines like V8 and SpiderMonkey, which are being worked on by teams of hundreds of people.

VersionStatus
Java 8 (2014)Nashorn introduction
Java 11 (2018)Deprecation (JEP 335)
Java 15 (2020)Complete deletion (JEP 372)

After Nashorn was removed in Java 15, the javax.script API itself remained, but the implementation disappeared. The standard way to call JavaScript from Java has disappeared.

Approach to replace the entire JVM with GraalVM

GraalVM is a multilingual JVM implementation developed by Oracle that builds GraalJS (JavaScript) and GraalPy (Python) on the Truffle language implementation framework. This is an approach that achieves multilingual support by replacing the JVM itself entirely.

Although it was technically superior, the hurdles to implementation were high.

  • Requires migration from HotSpot (standard JVM) to GraalVM
  • Compatibility issues with existing operation and monitoring tools
  • GraalVM’s JIT compiler works differently than HotSpot’s C2 JIT and has different performance characteristics.
  • Operations team dislikes “replacing the JVM” in an enterprise environment

Then, in September 2025, Oracle separated GraalVM from the Java version cycle. GraalVM for JDK 24 was the last Java SE product release, and since then we have shifted our focus to support non-Java languages ​​such as GraalJS and GraalPy. The experimental Graal JIT compiler was also removed from the Oracle JDK in favor of the standard C2 JIT.

With GraalVM leaving the Java ecosystem, the official way to call JavaScript and Python from Java has also been lost.

Project Detroit is no longer being reimplemented

Project Detroit itself was launched once in 2018. At that time, it only targeted JavaScript (V8), but it lost its sponsor group and was officially disbanded in September 2024.

It was re-proposed in February 2026, led by Sundararajan Athijegannathan. This time, Python support has been added, and the project is officially in progress after voting on the OpenJDK mailing list.

The decisive change in my third attempt was that I completely abandoned the approach of “reimplementing JavaScript and Python on the JVM”.

Why we decided to avoid “reimplementation” and instead design “embedding”

Bernard Traversat, Oracle’s VP of Software Development, explains:

“In the past with Nashorn, we tried to fully implement JavaScript on top of the JVM. The problem is that the entire JavaScript ecosystem is built on V8 and Node.js (based on V8). You’re always swimming against the flow.”

V8 is an open source JavaScript engine developed by Google and used by Chrome, Node.js, Deno, Cloudflare Workers, and others. In addition to following the ECMAScript specifications, optimizations such as JIT compilation using TurboFan and Orinoco GC are constantly progressing. CPython is the official reference implementation of Python, and is the first to reflect any changes to the specification in Python Enhancement Proposals (PEPs).

Rather than reimplementing them, embed the native runtime directly into the JVM process. JS that runs on V8 will work as is on Project Detroit, and specification tracking can be done by simply incorporating updates to V8/CPython. Optimizations from each community can be used as is, and behavioral differences in corner cases due to reimplementation are eliminated.

FFM API is the key to realization

So why didn’t things go well in 2018? The technical key lies in the Foreign Function & Memory (FFM) API (JEP 454), which was formalized in Java 22 (March 2024).

The FFM API is a product of Project Panama and is a native code integration mechanism that replaces JNI (Java Native Interface). JNI has been around since 1996, but it was boilerplate-heavy, had dangerous memory management, and had significant performance overhead.

Comparison itemJNIFFM API
IntroductionJava 1.1 (1997)Java 22 (2024)
Native code callC/C++ header generation requiredComplete with Java code only
Memory managementManual management, difficult to collaborate with GCSecure management with MemorySegment
PerformanceWith JNI overheadLow overhead

The FFM API makes it possible to call V8 and CPython C libraries from Java in a “very thin layer.” As of 2018, there was only JNI, and even if V8 was incorporated, practical performance could not be achieved. Formalization of the FFM API was a technical prerequisite for the relaunch of Project Detroit.

Security model with heap isolation

Project Detroit uses a completely isolated heap design.

graph LR
    A[JVMプロセス] --> B[Javaヒープ]
    A --> C[V8ヒープ]
    A --> D[CPythonヒープ]
    B -.->|javax.script API| C
    B -.->|javax.script API| D

Java, V8, and CPython each have independent memory spaces (heaps). Exchange between languages ​​is done by copying data through the javax.script API. This means that JavaScript code cannot directly access the Java heap.

Because GraalVM’s Truffle framework was designed to share objects between languages, there was a risk that vulnerabilities in one language could spread to the other. Project Detroit’s heap isolation model provides sandbox-like isolation.

How to use it specifically

Scripting business logic

In enterprise Java applications, there are many cases where you want to externalize business rules. These include insurance rate calculations, workflow branching conditions, and validation rules. By writing this in JavaScript and executing it via the javax.script API, you can change the rules without recompiling or redeploying the Java application.

Since Nashorn was removed, many sites have been running Node.js in an external process or relying on third-party scripting engines for this purpose.

Access to AI/ML library

The biggest motivation for Python collaboration is AI/machine learning. Georges Saab, SVP of Oracle Java Platform Group, said:

“Detroit’s main advantage is the ability to combine industry-leading Java and JavaScript, or Java and Python, wherever you want to use both technologies together.”

Ecosystem assets such as PyTorch, NumPy, scikit-learn, pandas, and HuggingFace Transformers can be called directly from within the Java process. Currently, to use a Python ML model from a Java application, it is common to set up a Python service in a separate process using REST API or gRPC.

graph TD
    subgraph 現状
        A1[Java App] -->|REST/gRPC| B1[Python ML Service]
        B1 --> C1[PyTorch / NumPy]
    end
    subgraph Project Detroit後
        A2[Java App] -->|javax.script API| B2[CPython in-process]
        B2 --> C2[PyTorch / NumPy]
    end

Inter-process communication is no longer required, reducing both latency and infrastructure costs. However, the details of how CPython’s GIL (Global Interpreter Lock) will coexist with the JVM’s multithreading model have not yet been made public.

SSR (server side rendering)

It can also be used to render React or Vue components on the server side from a Java backend. Currently, it is necessary to create a separate Node.js process for SSR, but if V8 runs within a JVM process, Java business logic and React rendering can be completed in a single process.

Relationship and division with GraalVM

GraalVM isn’t gone. GraalVM has simply broken away from Java’s version cycle, while multilingual support for GraalJS, GraalPy, GraalWasm, etc. continues on its own release cycle.

ItemProject DetroitGraalVM
Change JVMNo longer needed (remains HotSpot)Replace with GraalVM JVM
Language implementationIncorporating V8/CPython as isReimplementation on Truffle
HeapFully isolatedShareable
Ecosystem compatibilityFull (native runtime)Almost compatible (with differences due to reimplementation)
Target audienceOpenJDK/HotSpot usersGraalVM ecosystem users
Release cycleScheduled to be integrated into OpenJDKUnique cycle

Project Detroit will serve the majority of Java users who don’t want to change their JVM, while GraalVM will serve those who utilize GraalVM’s Native Image and Truffle ecosystems.

Current status

Sponsored by the OpenJDK Compiler Group, development is progressing in two repositories: detroit-js (JavaScript implementation) and detroit-python (Python implementation). It is released under the GPLv2 license.

It is still at the stage of proposing integration into OpenJDK, and it has not been determined which Java version it will be included in. JavaScript and Python are the initial targets, with plans to add other languages ​​in the future.


I still don’t know if it will work the third time, but the premise is different from the previous two, as the technical foundation of the FFM API is in place.