How to switch between different java versions on Linux

👉Open Terminal and type sudo update-alternatives --config java ┌─[root@parrot]─[~]
└──╼ $update-alternatives --config java

There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-10-openjdk-amd64/bin/java      1101      auto mode
  1            /usr/lib/jvm/java-10-openjdk-amd64/bin/java      1101      manual mode
* 2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode
  3            /usr/lib/jvm/java-9-openjdk-amd64/bin/java       1091      manual mode

Press <enter> to keep the current choice[*], or type selection number:


👉can select desired version by entering the selection number

Popular posts from this blog

Basic Linux Tips

Some Of Useful Run/Cmd Commands