How to configure Java environment variables
Java environment variable configuration:
setting of the 1.java_home variable
Settings for 2.Path variables
Settings for 3.Classpath variables
Of course, before we do, we need to download the Java SDK jdk
.
JDK Download
1
"Baidu Search ' jdk ', enter the first article.
.
2
"" In downloads select Java download to enter Java download list
.
3
"" Click on Accept License agreement, select the Windows section to download the installation package.
.
4
Once downloaded, go to the folder and double-click the application to install as prompted until the installation is complete.
.
5
"" To test if the JDK was successfully installed, search for cmd in start and enter "Java-version".
. END
Java_home variable Settings
1
First, right-click Computer to go to properties and select Advanced system settings.
.
2
Click on "Environment variables" in "Advanced" to enter the environment variable editing interface.
.
3
In the "System variables" below, there is no java_home variable, then we need to click "New"
.
4
Variable name input: Java_home
The value of the variable refers to the actual installation path (for example, the path of the small part is: C:\Program files\java\jdk-9).
Finally click OK.
. END
Path variable settings
1
Also in "System variables" we can see that the path variable already exists, then we just need to click "Edit" to enter the PATH variable edit
.
2
Variable name unchanged, variable value changed to "%java_home%\bin;%java_home%\jre\bin;", finally click OK.
. END
Classpath Variable Settings
-
.
2
Variable name type "Classpath"
Variable value type ".; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; 】
Be careful not to omit the symbol from the variable value, and then click OK.
. END
Test environment configuration is successful
1
After you complete the above three variables configuration, do not forget to click OK one step at a.
Similarly, search for "cmd" in "Start".
Then, type "java" and "Javac".
A message appears stating that the configuration was successful.
.
How to configure Java environment variables