...
This is my preferred approach. I launch a terminal and make a specific Java version available or the particular session. Upon exit of the terminal, everything is back to normalThis change is not permanent and I can load multiple terminal sessions testing with different versions of Java.
From the command line you can just type,
...