Table of contents
Install JDK1.8
JDK8 download link: JDK1.8
downloads the corresponding version according to your own system, I downloaded 64-bit
After clicking download, select I accept, click Download
If you are not logged in to Oracle, you need to log in to download (if you do not have an Oracle account, you can register for one)
After logging in, you can download it, wait for the progress bar to finish, open it in the folder, and double-click the **JDK1.8-** file to install it.
Follow the prompts to install (the next step). You should pay attention to the following step. If you want to install JDK to a certain directory, you can choose it yourself.
Proceed to the next step and select the installation directory again (this installation directory is the directory of JRE) until it appears. If there is no previous one is the default, this one can also be kept as the default, and click Next
You'll know it's installed when the close button appears!
This is the folder after my installation (I modified the folder name)
At this time, we will not do the test, and we will test after the environment variable configuration is completed!
Environment variable configuration
First, we find the computer picture on the desktop, right-click, and select Properties. The system settings will open. Select Advanced System Settings below
Pop-up system properties, select environment variables.
At this point, we click New in System Variables, and a new window pops up
. Fill in the variable name and variable location in the pop-up window, as shown below:
Variable name: JAVA_HOME Variable value: D:\Dev_Environment\java\jdk1.8
where the variable name is the name of the variable
variable value is the path of the newly installed JDK (change according to your installation location)
Create the CLASSPATH path in the same way
Variable name: CLASSPATH Variable value: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
Note: (Add . to indicate the current path)
Next, find the "PATH" path, click "Edit" to add our variable path
Add the following two paths in the path path (these two paths are best placed at the top of the path)
and click New to add
%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin
Click OK, OK, OK. At this point, the Java environment variables have been configured! Next we use DOS for testing!
test
Search for CMD, find the command prompt, and open it as an administrator.
After opening, there is a black box (using the English input method)
to enter **java -version**, **java**, javac commands to test, and press Enter after typing, when the following interface appears, it proves that the environment variable configuration is successful!
If the java command is available, but the javac command is not, you need to carefully check the configuration of the environment variables. On the contrary, it is necessary to check carefully!
If Error: could not open `D:\Java\jre7\lib\amd64\jvm.cfg';JAVA_HOME is prompted , put the java path location in the path path to the front (open a new DOS window and test again).