User Tools

Site Tools


software:java:start

Java

Multiple versions of Java are installed on our Linux systems. The default version is JDK8. If you want to switch the version of Java that the default java commands will operate on, use the “chjava” command (change java).

Here are some examples:

To see the default Java version that will be used, use the “chjava -q” command:

% chjava -q
jdk8

% javac -version
javac 1.8.0_202

Now let's change the Java version to JDK11:

% chjava

Available JDK Versions:

0. always use default JDK, presently jdk8 (*)
1. jdk8
2. jdk11
3. jdk17

Select JDK Version (0-3): 2
JDK set to jdk11.

% javac -version
javac 11.0.13

Now let's switch to JDK17:

% chjava

Available JDK Versions:

0. always use default JDK, presently jdk8
1. jdk8
2. jdk11 (*)
3. jdk17

Select JDK Version (0-3): 3
JDK set to jdk17.

% javac -version
javac 17.0.1

Finally, let's switch back to the default Java version:

% chjava default
JDK set to default.

You can also switch the java version on the command line:

% chjava jdk17
JDK set to jdk17.
javac -version
javac 17.0.1

If you have any questions, please contact tech support.

software/java/start.txt · Last modified: 2021/12/14 15:19 by jas