1. Download JDK
Check out the latest: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Select the appropriate JDK according to the operating system to download
2. Run the JDK installer
3. Select the installed directory
4. Click Next to confirm and execute the installation
5. Set JAVA environment variables
Right click on the computer - Properties - Advanced system settings - Environment variables
Create new environment variables
JAVA_HOME=C:/Program Files/Java/jdk1.8.0_40
CLASSPATH=.;%JAVA_HOME%/lib
Modify the PATH environment variable and add %JAVA_HOME%/bin to the PATH environment variable
6. Verify that the installation is successful
Enter cmd, enter Enter, and the command box pops up in Start-run
Enter java -version
If the output installs JKD version, the installation is successful