1. DownLoad Oracle JDK
Oracle jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Install JDK in Windows
Updating the PATH Environment Variable
If you don't set the path variable, you need to specify the full path to the executable file every time you run it,
such as:
c:\> "C:\Program Files\java\jdk1.8.0\bin\javac" Myclass.java
It is useful to set the PATH variable permanently so it would persist after rebooting.
To set the path variable permanently and add the full path of the Jdk1.8.0\bin directory to the PATH variable.
Typically, this full path looks something like C:\Program files\java\jdk1.8.0\bin.
Set the PATH variable as follows on Microsoft Windows:
Click Start, then Control Panel, then System.
Click Advanced and then environment Variables.
ADD the location of the Bin folder of the JDK installation to the PATH variable in System Variables.
The following is a typical value for the PATH variable:
C:\WINDOWS\system32; C:\WINDOWS; C:\Program Files\java\jdk1.8.0\bin
Note:
The PATH environment variable is a series of directories separated by semicolons (;) and are not case-sensitive.
Microsoft Windows looks for programs in the "PATH Directories in order" from "left" to "right".
You should only has one bin directory for a JDK with the path at a time.
Those following the first instance is ignored.
If you is not a sure where to add the JDK path, append it.
The new path takes effect in each new command window to open after setting the path variable.
3. Other Study Source
Runoob:http://www.runoob.com/java/java-tutorial.html
Oracle document:http://docs.oracle.com/javase/8/
Java Study First article--Install JDK