Windows 7 – Right click My Computer and select Properties > Advanced
2.Windows 8* – Go to Control Panel > System > Advanced System Settings Windows 10 – Search for Environment Variables then select Edit the system environment variables
Click the Environment Variables button.
Under System Variables, click New.
In the Variable Name field, enter either:
JAVA_HOME if you installed the JDK (Java Development Kit)
or
JRE_HOME if you installed the JRE (Java Runtime Environment)
In the Variable Value field, enter your JDK or JRE installation path.