JAVA_HOME environment variable setting
First right-click [Computer] and enter [Properties] and then select [Advanced System Settings]
Click to enter [Environment Variables] in [Advanced] to enter the environment variable editing interface
Click [System Variables] below 】, the JAVA_HOME variable does not exist, then we need to click [New]
Variable name input: JAVA_HOME
Recommended learning video tutorial: java video tutorial
The variable value refers to the actual installation path (for example, the editor's path is: C:\Program Files\Java\jdk-9), and finally click OK.
PATH variable setting
Also in [System Variables] we can see that the path variable already exists, then we only need to click [Edit] to enter the path variable Edit
The variable name remains unchanged, the variable value is changed to [%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;], and finally click OK
Classpath variable setting: There is no need to set classpath after java1.5 version
Similarly, there is no Classpath variable in the system variables. Click to enter [New]
Type the variable name [Classpath]
Type the variable value [.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME %\lib\tools.jar; ]
Be careful not to miss the symbols in the variable value, and finally click OK
Test whether the configuration is successful
Similarly, search [cmd] in [Start], and then type [java] and [javac].
The message shown in the figure appears, indicating that the configuration is successful.
java learning tutorial recommendation: java quick start
The above is the detailed content of How to set java environment variables. For more information, please follow other related articles on the PHP Chinese website!