Java environment variable configuration

Source: Internet
Author: User

1. Install JDK. You can customize the installation directory and other information during the installation process. For example, select c: \ Program Files \ Java \ jdk1.7.0 _ 01 as the installation directory;

2. After the installation is complete, right-click "my computer" and click "properties ";

3. Select the "advanced" tab and click "environment variables ";

4. In "system variables", set three attributes: java_home, path, and classpath (case-insensitive). if it already exists, click "edit". If it does not exist, click "new ";

5. java_home indicates the JDK installation path, which is the path c: \ Program Files \ Java \ jdk1.7.0 _ 01 selected during installation. This path includes Lib, bin, JRE and other folders (it is best to set this variable, because later running tomcat, Eclipse, etc. all need to follow * this variable );

 

Path allows the system to recognize Java commands in any path. It is set:

% Java_home % \ bin; % java_home % \ JRE \ bin

 

Classpath is the classorlib path of the Java load class. Only the class in classpath can be identified by the Java command and set:

.; % Java_home % \ Lib \ DT. jar; % java_home % \ Lib \ tools. Jar (Add. to indicate the current path)

 

% Java_home % refers to the previously specified java_home;

6. "Start"->; "run", type "cmd ";

7. type the following commands: "Java-version", "Java", and "javac". If a screen is displayed, the environment variable is successfully configured;

 

Problems encountered during self-configuration: Entering the javac command to display javac is not a command error, while entering Java will display relevant information normally. Tested ProblemsYou only need to put the environment variables set in the path at the beginningThe problem is solved.

I am a Windows 7 system and JDK is jdk1.7.0 _ 01;

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.