To Configure Java JDK (Windows)
In Search, search for System (Control Panel) and select it.
Click Advanced System Settings.
Click Environment Variables.
In System Variables, select the PATH environment variable.
If the PATH environment variable does not exist, click New.
In Edit System Variable (or New System Variable), make sure that the JDK 1.8.0/bin directory is the first item in your PATH environment variable, and click OK.
Blank spaces are not allowed when defining a path on Windows.
To verify that your installation was configured correctly, reopen the command prompt window, and type:
> java -version
This should print the version of the java tool.
If the version is other than your desired JDK, or you get the error "java: Command not found", then the JDK is not properly installed.