1. Download
www.oracle.com/technetwork…
I need to register my Oracle account when I download JDK1.8 from the official website, but it is not too much trouble, it takes a few minutes.
To download the version shown in the picture, please click accept license agreement.
JDK 8uXXX is already JDK1.8, 221 is just a minor version of JDK1.8.
Above is the previous UI, to supplement the UI of the new official website, click here:
2. Install
You can change the JDK installation directory in the middle. It is recommended to create a Java folder where the JDK and JRE are stored
In fact, direct installation of the default path can also be, but MY C disk space is a little small.
The same goes for installing the JRE after installing the JDK.
3. Configure environment variables
How to configure is not mentioned, directly look at the configuration items:
- Create JAVA_HOME with the value of your previous JDK installation directory, such as C:\Program Files(x86)\Java\jdk1.8.0_101
- Create the CLASSPATH with the value. %JAVA_HOME%\lib; %JAVA_HOME%\lib\dt.jar; %JAVA_HOME%\lib\tools.jar (note the first point).
- Edit Path and add two values: %JAVA_HOME%\bin; And the % JAVA_HOME % \ jre \ bin;
Finally, enter CMD Java -version to test