Book Image

OpenJDK Cookbook

Book Image

OpenJDK Cookbook

Overview of this book

Table of Contents (20 chapters)
OpenJDK Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Building OpenJDK 9 with Graal


As described in the project page, Graal is:

A quest for the JVM to leverage its own J.

Upon completion of this project, JVM functions will be exposed via Java APIs, so the end user will be able to have access to the most low-level manipulation. It will be possible to write a Java compiler in Java, for example. Now, we will try to give it a test.

There is also Truffle, a framework that allows you to build your own language using Graal VM. It builds upon a notion of an abstract syntax tree (AST), and the process, in fact, is really simple. To have a better look, see the following link:

https://cesquivias.github.io/blog/2014/10/13/writing-a-language-in-truffle-part-1-a-simple-slow-interpreter/

Getting ready

You will need an Internet connection. Also, it's recommended to read the chapters about building OpenJDK.

How to do it...

Have a look at the following procedure to build OpenJDK with Graal:

  1. First, clone a source repository:

    hg clone http://hg.openjdk.java.net/graal/graal...