Home > Java > JavaBase > body text

How to configure java environment variables

angryTom
Release: 2019-11-12 11:14:42
Original
9807 people have browsed it

When we need to use Java for program development, we must first install jdk, and then configure the Java environment variables according to the jdk installation directory. So how to configure the Java environment variables?

How to configure java environment variables

How to configure java environment variables

For Java program development, two commands of the JDK are mainly used: javac. exe,java.exe. Assuming path: C:\Java\jdk 1.7.0 _09\bin. However, since these commands are not Windows' own commands, if you want to use them, you need to configure the path. (Recommended tutorial: java tutorial)

Click "Computer-Properties-Advanced System Settings" and click "Environment Variables". Click "New" under the "System Variables" column to create a new system environment variable.

How to configure java environment variables

(1) Create new->Variable name "JAVA_HOME", variable value "C:\Java\jdk1.8.0_05" (that is, the installation path of JDK)

(2)Edit->Variable name "Path", add ";%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin" at the end of the original variable value

(3) New -> Variable name "CLASSPATH", variable value ".;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar"

Confirm environment configuration Is it true:

javac command:

How to configure java environment variables

cmd-->java -version

Detect JAVA version

The above is the detailed content of How to configure 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