Home > Article > System Tutorial > Detailed method for configuring Windows 10 JDK environment variables
JDK environment variable configuration is the first step to learn Java. When developing Java programs, you definitely need to reference classes that have been written by others. When we reference other people's classes, we need to let the interpreter know. Where to reference this class. Let’s take a look at the detailed installation and configuration methods under win10 system.
1. Install JDK. Select the installation directory. Two installation prompts will appear during the installation process.
The first time is to install jdk, and the second time is to install jre. It is recommended to install both in different folders within the same java folder.
(Cannot be installed in the root directory of the java folder, an error will occur if jdk and jre are installed in the same folder)
2. Configure environment variables : Right-click "My Computer"-->"Properties"-->"Advanced System Settings"-->"Advanced"-->"Environment Variables"
1. In System Variables Create a new "JAVA_HOME" variable here,
The variable value is: C:\Program Files\Java\jdk1.8.0_60 (fill in according to your own jdk installation path)
2. Create a new "classpath" variable in the system variables. The variable value is: .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar (note the dot at the front)
3. Find the path variable (do not create a new one if it already exists) and add the variable value: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin
Note that the variable values are separated by ";". Pay attention to whether there is a ; sign at the end of the original Path variable value. If not, enter the ; sign first and then enter it.
If your system is Windows 10, it is relatively more convenient. Don’t worry about this ";".
3. "Windows R"-->Enter "cmd"-->Enter, enter java -version (remember there is a space in the middle),
If the jdk version information is displayed, It means that the environment variable configuration is successful.
The above is the detailed content of Detailed method for configuring Windows 10 JDK environment variables. For more information, please follow other related articles on the PHP Chinese website!