What versions of JAVA are available?
In addition to the default JAVA provided by the OS, we have several older and newer versions of JAVA compiler available. To see what versions of JAVA are available:
$ module avail java
------------------- /usr/local/modules -----------------------------------
java/8 java/11 java/15 java/17
To load the latest version of JAVA:
$ module load java
Or to load a specific version of JAVA:
$ module load java/15
Confirm:
$ module list
Currently Loaded Modulefiles:
1) java/15
And to confirm:
$ javac --version
javac 15.0.1
How can I switch to a different version of JAVA?
If you have loaded a JAVA version and would like to switch to a different version:
$ module switch java/<VERSION>