Check out example codes for "change java version command line debian". It will help you in understanding the concepts better.

Code Example 1

sudo update-alternatives --config java

Code Example 2

sudo update-alternatives --config java

Learn ReactJs, React Native from akashmittal.com