Java environment variable Configuration

Source: Internet
Author: User

1. Installing the JDK

A. During the installation of the JDK, there are two prompts to select the installation directory, the first time you select the JDK installation directory, and the second time you select the JRE installation directory. It is recommended that you install them separately under the JAVA/JDK and Java/jre folders for management.

B. cannot be installed in a folder (such as the Java folder) root directory, because the JDK and JRE installed in the same folder will be error.

2. JDK environment variable configuration (three steps)

A. Computer → properties → advanced system settings → advanced → environment variables

B. New Java_home variable

Steps:

System variables → new system variables

Variable name: "Java_home"

The value of the variable is the installation directory of the JDK, the main topic is "D:\Java\java1.6\jdk1.6.0_43"

C. Add Path variable

Steps:

System variables → find Path variable → edit

At the end of the variable value, enter "%java_home%\bin;%java_home%\jre\bin;" (Note that the original path of the variable value at the end of there is no; number, if not, first enter; number and then enter the above code)

D. New Classpath variable

Steps

System variables → new system variables

Variable name: "CLASSPATH"

Variable value: ".; %java_home%\lib;%java_home%\lib\tools.jar "(Note that there is a point in the front)

3. Java Environment Inspection

Run the cmd input java-version (there are spaces between Java and-version)

Java environment variable Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.