1. Preparatory work
A. Because the Java JDK distinguishes between 32-bit and 64-bit systems, you must first determine how many bits of our system are in place before installing. Right-click Computer-Properties view, I installed 64-bit
b. Download JDK, Address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, I downloaded the JDK for 8,:
2. Installing Java JDK8.0
A. Double-click on the downloaded JDK to install it, next step to go, don't say much.
3. Configure environment variables (automatically set with BAT file)
A. Create a file Java_home.bat
B. Copy the following code into the file. Note Modify your JDK installation path: C:\Program files\java\jdk1.8.0_77
-The first Kind
@echo off:: Configure java_home WMIC Environment create name="Java_home", username="<system>", variablevalue="C:\Program files\java\jdk1.8.0_77": : Configuration: CLASSPATH WMIC Environment create name="CLASSPATH", username="<system>", variablevalue=".; %%java_home%%\lib\dt.jar;%%java_home%%\lib\tools.jar;": : Configuration: PATH WMIC Environmentwhere "name= ' PATH ' and username= ' <system> '" SetVariablevalue="%%java_home%%\bin;%%java_home%%\jre\bin;%path%"Pause
--The second type (turn from: http://www.cnblogs.com/flowwind/p/4066146.html)
@echo off:: TODO: Setting the Java environment variable:: Author:gwtcolor Geneva:: Set Java installation path, easy to switch between different versionsSetinput=Set/P"input= Enter the Java JDK path (or enter the default path to C:\Program files\java\jdk1.7.0_71):"ifDefined input (echo JDK is set)Else(SetInput=c:\program Files\java\jdk1.7. 0_71) The echo JDK path is%input%Setjavapath=%input%:: If any, remove java_homewmic environment firstwhere "name= ' Java_home '"Delete :: If any, remove Class_path WMIC environment firstwhere "name= ' Class_path '"Delete:: Creating java_homewmic Environment Create name="Java_home", username="<system>", variablevalue="%javapath%":: Creating class_pathwmic Environment Create name="Class_path", username="<system>", variablevalue=".; %%java_home%%\lib\tools.jar;%%java_home%%\lib\dt.jar;":: In the environment variable path, remove the character from the variable java_home and echo the remaining string callSetXx=%path%;%java_home%\jre\bin;%java_home%\bin::echo%xx%:: Re-assigns the returned explicit character to the path in WMIC environmentwhere "name= ' Path ' and username= ' <system> '" SetVariablevalue="%xx%"Pause
JDK installation configuration in Windows Tutorial