How to install Java 9?

Today I started playing with Java 9 on my Ubuntu 17.04. So, I thought it might be handy for other to know how to install Java 9 on Ubuntu. Here are the steps:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt install oracle-java9-installer
// Set Java 9 to be primary (if you have more than one version of Java on your PC)
$ sudo update-alternatives --config java
// Set JAVA_HOME to point to Java 9
$ export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
// Check Java 9
$ javac -version