Once you've installed a newer version of the JDK with an earlier version already installed, it is possible to switch what the currently selected version is.
On macOS and Linux, you do this by switching the value of JAVA_HOME
The following command switches the current Java platform to Java 8:
$ export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
To switch to Java 9, use the following command:
$ export JAVA_HOME=$(/usr/libexec/java_home -v 9)
With this command, you are passing the Java version of choice to the -v parameter. But, note that the format is different between Java 8 and 9. With Java 8, the version string is 1.8. With Java 9, the version string is just 9. Traditionally, Java has been using the 1.X version format, for example, Java version 7 had the version string 1.7. This is being changed from Java 9 onward. The idea is that subsequent releases...