How to Set Java environment variables

Source: Internet
Author: User

After JDK is installed successfully, check whether the installation is successful. Enter "java-version" in the command prompt and press the Enter key. If the following version information is displayed:

Java version "1.6.0 _ 26"

Java (TM) SE Runtime Environment (build 1.6.0 _ 26-b03)

Java HotSpot (TM) Client VM (build between 1-b02, mixed mode, sharing)

Indicates that JDK has been installed successfully.

The following describes how to set Java environment variables.

1. Open my computer -- properties -- Advanced -- Environment Variables

2. Create System variables JAVA_HOME and CLASSPATH

Variable name: JAVA_HOME

Variable value: C: Program FilesJavajdk1.7.0

Variable name: CLASSPATH

Variable value:.; % JAVA_HOME % libdt. jar; % JAVA_HOME % libtools. jar;

3. select the environment variable named "Path" in "system variables" and double-click the variable to add the absolute Path of the bin directory in the JDK installation Path to the value of the Path variable, separate them with semicolons (;) and existing paths.

Variable name: Path

Variable value: % JAVA_HOME % bin; % JAVA_HOME % jrebin;

Finally, test whether the environment variable is successfully configured. You can enter "javac" in the command line window and press Enter. The output help information indicates that the configuration is correct.

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.