Check out example codes for "change javahome cmd". It will help you in understanding the concepts better.

Code Example 1

setx JAVA_HOME -m "Path"

Code Example 2

echo %JAVA_HOME%

Learn ReactJs, React Native from akashmittal.com