software:java:start
This is an old revision of the document!
Java
Multiple versions of Java are installed 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 version that will be used, you can call “chjava -q”:
jdk8 % javac -version javac 1.8.0_202
Now we can change the java version - let's choose 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.1639513049.txt.gz · Last modified: 2021/12/14 15:17 by jas