Since the system is redone, and Android class compilation and decompilation work is usually required, so I reinstalled the JDK and shared the process records.
Specific steps
First, download the JDK installation package and go to the official website http://www.oracle.com/technetwork/java/javase/downloads/index.html to download it. Click Java Platform (JDK) 7u51 on the left to enter the next download page.
Click the Accept License Agreement on the left to accept the license agreement before you can download it. Since I installed the WIN7 64-bit system, I choose the corresponding 64-bit installation package.
Download the corresponding jdk-7u51-windows-x64.exe for Windows x64.
After downloading and installing, I am used to installing the software on D drive. You can change the storage location according to your habits.
After installation, you can configure the JDK environment variables. Right-click the computer on the desktop to select properties, or right-click the computer on the Start menu to select properties, click Advanced System Settings on the left, and click the environment variables below.
On the new pop-up window, click the New button below the system variable area to pop up the new window. The variable name is JAVA_HOME, and fill in the final path of the JDK installation with the variable value. The address I installed here is D:/Program Files/Java/jdk1.7.0_51, so fill in D:/Program Files/Java/jdk1.7.0_51, click OK to complete.
The following is to set the Path variable. Since this variable already exists in the system itself, there is no need to create it. In the original form, you basically add JDK-related items. Double-click to edit the Path variable. Since each value is used between the two values, you can add it at the end first; (note that it is in English format, do not enter other symbol spaces, etc.), add it; after the symbol, add %JAVA_HOME%/bin at the end, click to confirm and complete,
Below, add the CLASSPATH variable. Since it does not exist, create a new one, with the variable name CLASSPATH, the variable value %JAVA_HOME%lib/dt.jar;%JAVA_HOME%/lib/tools.jar, without spaces at the beginning and end, click to confirm and complete. At this point, the environment variable configuration is completed, click to confirm and close the environment variable configuration window.
After the above steps are completed, verify whether the configuration is successful. Click Start to run and enter cmd to open the command line window, enter java -version, display version 1.7.0_51, enter javac -version, and also display 1.7.0_51, indicating that the JDK installation and environment variable configuration are successful.
Notes:
Since my installation path is on D disk, the value of the JAVA_HOME variable is the D disk path, and everyone must set it according to their installation path. Since the JDK version I installed is 1.7.0_51, this version is displayed during verification, and different versions are displayed differently.
The above is the method of installing and configuring environment variables by JDK. I hope it will be helpful to everyone's learning.