set the java home variable via the command line

Solutions on MaxInterview for set the java home variable via the command line by the best coders in the world

showing results for - "set the java home variable via the command line"
Victoria
26 Nov 2017
1> Open Command Prompt (make sure you Run as administrator)
2  
3      Click on start Button >> type ' cmd 'in search Box >> Press Right mouse button on cmd >> 
4      In a pop-up select " Run as administrator "
5        
6
7
8> COPY THIS COMMAND & SET YOUR JDK INSTALLED PATH IN DOUBLE QUOTES (" ") :  
9                       
10      setx -m JAVA_HOME "C:\Progra~1\Java\jdk1.8.0_XX"
11                       
12  NOTE: If the path contains spaces, use the shortened path name.
13
14
15> Restart Command Prompt to reload the environment variables 
16  then use the following command to check the its been added correctly. 
17 
18      echo %JAVA_HOME%
19                       
20> You should see the path to your JDK (or JRE) installation.