Installing JDK9 on Max OSX

  • July, 12 2017
  • Manik Magar
  • java9

Java 9 is almost ready for GA release. If you haven’t yet got the JDK9 installed and playing with it, I suggest you do it right now and check out some awesome features of Java 9.

Below we will see two ways to install JDK9 on Mac OSX (Sierra 10.12.5).

Feeling Lazy to build yourself a JDK?

If you don’t want to get out of couch and feeling lazy then easiest way to install JDK9 is to go to OpenJDK EA Build and download the build specific to your OS. Fox Mac OSX, download the .dmg package and install it.

OpenJDK9 Early Access Download

Verify Installation

Once installation completes, run below command to list all installed JDks.

/usr/libexec/java_home -V

Your output should look like below -

Matching Java Virtual Machines (5):
    9, x86_64:	"Java SE 9"	/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
    1.8.0_131, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
    1.8.0_73, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home
    1.8.0_60, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
    1.7.0_79, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home

Boom! We have the JDK 9 installed now. You can set your JAVA_HOME to point to JDK9 installation directory and start using the JDK.

Adventurous mode on for building JDK?

OpenJDK source code is available online and you can easily download it and build the JDK for yourself.

Mihail Stoynkov have documented steps on this blog. It will be fun to build JDK, So go ahead!

Verify Installation

Assuming you have built jdk9 in ~/jdk9 directory, your built jdk should be at path ~/jdk9/build/macosx-x86_64-normal-server-release/jdk/.

Run below commands in terminal.

cd ~/jdk9/build/macosx-x86_64-normal-server-release/jdk/bin
./java -version

This should print java version similar to below -

openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-adhoc.manik.jdk9)
OpenJDK 64-Bit Server VM (build 9-internal+0-adhoc.manik.jdk9, mixed mode)

What is new in JDK9?

JDK9 is very feature rich. All JDK Enhancement Proposals (JEPs) are listed on OpenJDK page.

To get a started, watch this presentation by Simon Ritter on "55 New features in JDK 9" at Devoxx USA -

Enjoy JDK 9 and welcome to Java Streets!

on twitter to get updates on new posts.

Stay updated!

On this blog, I post articles about different technologies like Java, MuleSoft, and much more.

You can get updates for new Posts in your email by subscribing to JavaStreets feed here -


Lives on Java Planet, Walks on Java Streets, Read/Writes in Java, JCP member, Jakarta EE enthusiast, MuleSoft Integration Architect, MuleSoft Community Ambassador, Open Source Contributor and Supporter, also writes at Unit Testers, A Family man!