Home > Java > Java Tutorial > body text

How to configure environment variables in java

爱喝马黛茶的安东尼
Release: 2020-09-05 15:34:24
Original
40341 people have browsed it

How to configure environment variables in java

#Download JDK

Download address: https://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html

Click the download button:

How to configure environment variables in java

How to configure environment variables in java

Start installing JDK:

How to configure environment variables in java

can be set to the path you want to install.

Environment variable configuration

1. Open the environment variables window

right-click This PC(this Computer) -> Properties -> Advanced system settings -> Environment Variables...

How to configure environment variables in java

How to configure environment variables in java

How to configure environment variables in java

2. Create a new JAVA_HOME variable

Click the New... button

How to configure environment variables in java

Input:

Variable name: JAVA_HOME

Variable value: The absolute path of the JDK installation on the computer

After inputting, click OK.

How to configure environment variables in java

#The following files must be visible in the JDK path.

How to configure environment variables in java

3. Create/modify CLASSPATH variable

If the CLASSPATH variable exists, select it and click Edit.

If not, click New... to create a new one.

Enter/add after the existing variable value:

Variable name: CLASSPATH

Variable value: .;%JAVA_HOME%\lib\dt.jar ;%JAVA_HOME%\lib\tools.jar;

Click OK to save.

How to configure environment variables in java

#4. Modify the Path variable

Due to the difference in win10, when the Path variable is selected, the system will easily All different paths are separated and will not be connected together like win7 or win8.

How to configure environment variables in java

Create two new paths:

%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin
Copy after login

How to configure environment variables in java

##5. Check to open cmd, enter java, and a series of The command prompt indicates that the configuration is successful:


How to configure environment variables in javaPHP Chinese website has a large number of free

JAVA introductory tutorials

, everyone is welcome study!

The above is the detailed content of How to configure environment variables in java. For more information, please follow other related articles on the PHP Chinese website!

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 [email protected]
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!