Home

Oracle unveils Project Detroit for faster Java interop with JavaScript and Python

JavaOne Oracle has shipped Java 26, a short-term release, and introduced Project Detroit, which promises faster interop between Java, JavaScript, and Python.

Java 26 will be supported for just six months, until the release of Java 27 later this year. The next LTS (long-term support) Java release is expected to be Java 29 in September 2027.

Bernard Traversat, VP software development, said in a briefing that Java developers have long been interested in calling JavaScript from Java and, with the advance of AI, in calling Python code. Although solutions for this exist, the introduction of the FFM (Foreign Function and Memory) API in Java 22, as a more integrated and easier-to-use means of interop than the old JNI (Java Native Interface), has allowed "very thin layers that will enable you to go and call JavaScript, or from JavaScript call back to Java," he said.

Project Detroit will be proposed as an OpenJDK project soon, Oracle said, and will be presented at the JavaOne event opening today in Redwood City, California. The initial languages will be JavaScript and Python, with other languages to follow.

How will Project Detroit improve on existing solutions such as GraalWasm, which offers interop with other languages, including JavaScript, via WebAssembly?

"The novel approach that we are taking with Detroit is that we are embedding the V8 and CPython runtime directly inside the JVM process," Traversat told us. "In the past we had Project Nashorn, where we tried to do a full implementation of JavaScript on top of the JVM... the challenge is that you are always swimming against the current, because the entire ecosystem on JavaScript basically is building everything on V8 or Node.js, which is running on V8."

He added that the JavaScript and Python languages are "not as well specified as the Java language," resulting in "a lot of corner cases that are challenging to support." This problem is eliminated by using the most popular runtimes.

According to Traversat, "we are getting very good performance and a better security model. We can clearly isolate the Java heap versus what is running on the V8 heap or the CPython heap."

On the eve of JavaOne, Oracle had more to tell us. Project Helidon, an open source framework for microservices, will be contributed to the OpenJDK and have its versions aligned with those of the JDK, enabling immediate use of new JDK (Java Development Kit) features and alignment of LTS releases.

The company is also introducing the Java Verified Portfolio (JVP), described as a "set of services, libraries, frameworks, modules, and tooling" that are supported and validated for enterprise use. The JVP consists of Project Helidon, JavaFX, and the Java platform extension for Visual Studio Code (VS Code). Commercial support for JavaFX, a rich media and graphical framework, has been reintroduced, we were told, because of interest in interactive visualizations in AI and analytics applications.

Another new feature, aimed at those learning Java, is support for Java in VS Code Jupyter notebooks. There is also an addition to the Java Playground online learning platform, enabling sharing of code snippets with students.

AI is everywhere and Oracle is keen to position Java as keeping up, referencing projects such as Helidon AI, Langchain4j for integrating Java with large language models, Spring AI, and the Embabel framework for coding AI agents.

Does Oracle have a policy either internally or for external contributors regarding AI-generated contributions to the code? Not yet, Traversat said. "We're working and hoping to be able to have a clear policy around what is allowed and what is disallowed... of course, we want to be able to leverage AI."

New features in Java 26 itself are mostly incremental or updated previews of enhancements such as primitive types in patterns and switch statements, the Vector API and structured concurrency. HTTP/3 is now supported in the HTTP client API.

There is one footnote, though. The Java applet API has been removed. "It is obsolete because neither recent JDK releases nor current web browsers support applets," states JEP (Java Enhancement Proposal) 504. One of the original rationales for the confusingly named JavaScript, created by Netscape in 1995, was to script Java applets. Java applets are long gone, but Project Detroit shows that the need for interop between these two languages remains. ®

Source: The register

Previous

Next