The new support for Java on Truffle was introduced with GraalVM 21, which was released on January 19. A key feature of this release is the inclusion of a component called Espresso, which allows Java code to be executed via a Java bytecode interpreter that is implemented using the Truffle framework. This interpreter is complemented by additional core components of a Java virtual machine (JVM), including a .class file parser, a simple object model, and an implementation of Java Native Interface (JNI). Java versions 8 and 11 are currently supported in this setup, making it accessible to a wide range of Java applications.
What sets this development apart is the ability to run Java using the same underlying principles that apply to other languages within GraalVM, ensuring greater compatibility and potential for optimization. In previous versions of GraalVM, languages such as Python, Ruby, and JavaScript already benefited from the Truffle framework’s high-performance features. With Java now joining this list, it opens the door to better integration and performance for Java developers working within the GraalVM ecosystem.
However, it’s important to note that while Java on Truffle is a promising addition, its current performance does not yet reflect the full potential that future releases will bring. As GraalVM 21.x evolves, performance improvements for Java are expected to accelerate rapidly. This ongoing enhancement promises to make GraalVM an increasingly valuable platform for developers seeking to leverage the benefits of multiple languages and gain access to cutting-edge optimizations.