Windows 10 configure Java environment variables
Download JDK
Download link: https://www.oracle.com/java/technologies/javase-downloads.html
Enter the link to select the version you need to download
After the download is complete, the installation starts, the installation directory can be customized, and other items directly default to the next step, the default: C:\Program Files\Java\jdk1.8.0_261
Environment variable configuration
1. Open the environment variables window
Right click on This PC -> Properties -> Advanced system settings -> Environment Variables...
2. Create a new JAVA_HOME variable
Click the New... button
enter:
变量名:JAVA_HOME
变量值:电脑上JDK安装的绝对路径
3. New/modify CLASSPATH variable
If there is a CLASSPATH variable, select it and click Edit .
If not, click New... New.
Enter/add after the existing variable value:
变量名:CLASSPATH
变量值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
4. Modify the Path variable
Note that the different paths of the Path variable are separated in win10
Create two new paths:
%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin