Right-click on My Computer-Properties-Advanced System Settings
In the pop-up window, click the "Environment Variables" button in the lower right corner
Next, you can configure specific environment variables in user environment variables or system environment variables, click Edit to add new environment variables, and pay attention to separating them with semicolons.
Java environment variable configuration:
a. Add the path of the bin folder under the JDK installation path after path, for example: ";D:\JDK\bin"
b. Create a new javahome environment variable, the value is the installation path of the JDK, for example: "D:\JDK"
c. Create a new classpath environment variable. There are two values of this variable as "D:\JDK\lib\tools.jar;D\JDK\lib\td.jar"
Precautions
Note that you need to enter a semicolon in the English state