Home > Java > Javagetting Started > body text

How to set java environment variables

王林
Release: 2019-12-05 13:50:30
Original
10547 people have browsed it

How to set java environment variables

JAVA_HOME environment variable setting

First right-click [Computer] and enter [Properties] and then select [Advanced System Settings]

How to set java environment variables

Click to enter [Environment Variables] in [Advanced] to enter the environment variable editing interface

How to set java environment variables

Click [System Variables] below 】, the JAVA_HOME variable does not exist, then we need to click [New]

How to set java environment variables

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

How to set java environment variables

The variable name remains unchanged, the variable value is changed to [%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;], and finally click OK

How to set java environment variables

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]

How to set java environment variables

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

How to set java environment variables

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.

How to set java environment variables

How to set java environment variables

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!