Java environment variable configuration for Windows operating system

Source: Internet
Author: User

It is recommended that you install the JDK and the JRE as a Custom installation directory:

My JDK is installed in: G:/0.1.develop-tools/java/jdk1.7.0_07;jre installed in: g:/0.1.develop-tools/java/jre7

Environment variable configuration:

Computer (right key)-Properties-Advanced system settings-environment variables

① new system variable (java_home)

Variable name: java_home

Variable Value: g:/0.1.develop-tools/java/jdk1.7.0_07 (this directory is the path to the JDK installation, this path includes folders such as LIB,BIN,JRE)

② Edit System variable (CLASSPATH), if not the variable will need to be new; Classpath for Java Load class (class or Lib) paths, only classes in Classpath, Java commands can recognize

Variable name: CLASSPATH

Variable value:%java_home%/lib/dt.jar;%java_home%/lib/tools.jar; (note: The variable value is placed in the classpath; where the value of the variable is finally added ";")

③ Edit System variable (PATH), if not the variable, you need to create a new; Path enables the system to recognize Java commands under any path.

Variable name: PATH

Variable value:.; %java_home%/bin; (Note: The value of the variable is placed before the existing path value)

Second, test environment variables are configured successfully, the steps are as follows

1. "Start"---> "Run" or "win+r", type "cmd";

2. Type the command "Java-version", "Java", "Javac", appear similar to the picture below

Related Article

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.