Check out example codes for "linux command to see all the java version installed". It will help you in understanding the concepts better.

Code Example 1

sudo update-alternatives --display java

Code Example 2

sudo update-alternatives --config java

Learn ReactJs, React Native from akashmittal.com