how to install open jdk 11

Since I’m speaking at QCon about Java 11, I figure I should install it instead of just having read about it :).

Wait? Will this mess up my existing Java install?

No. Open JDK provides tar files. This means you can have as many versions installed as you want.

How to install

  1. Go to http://jdk.java.net/11/
  2. Download the Open JDK tar.gz file (It’s about 300 MB)
  3. Unzip
  4. Move to the directory you typically keep JDKs to make it easy to find. For example, on Mac:
    sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines
    cd /Library/Java/JavaVirtualMachines
  5. Optionally, add aliases. I like to create javacVersionNumber and javaVersionNumber so I can quickly compare multiple versions. For example, on Mac, I opened .bash_profile and added aliases for java 11 to the ones I already had.
    alias javac11=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/javac
    alias java11=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java