Eclipse Configuration Environment variables

Source: Internet
Author: User

Download jdk:http://www.oracle.com/technetwork/java/javase/downloads/index.html

3. Configure environment variables: Right-click "My Computer"-"advanced"-"Environment variables"

"Variable name": Java_home

"Variable value": C:\Program files\java\jdk1.7.0_07//The disk path of the JDK you installed

"Variable name": Path

"Variable value":%java_home%\bin;%java_home%\jre\bin;

"Variable name": ClassPath

"Variable value":.; %java_home%\bin;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar

Note: The above code is best also a character unchanged paste up, "variable value" the most front.; Don't miss out.

After completing the three steps above, the configuration of the environment variable has been completed.

Check environment variables set up: Bring up "cmd" check

1. Input: "Java", you should see the following things:

2, enter "Javac", you should see the following things:

3, enter "Java-version", you should see the following things:

If the above three pictures are seen, congratulations, the environment variable configuration is OK!

Why set the Java environment variable?

So far the setting of environment variables is not very understanding, and most of the information on the Internet is almost a setup method, did not say why. Learning Linux Today, encountered the settings of the Java environment variable, inadvertently found a detailed explanation of the Java environment variable settings.

1. Path environment variable. The function is to specify the command search path, and when executing the command under the shell, it looks in the path specified by the path variable to see if the appropriate command program can be found. We need to add the bin directory in the JDK installation directory to the existing path variable, and the bin directory contains the frequently used executables such as Javac/java/javadoc wait, and after setting the path variable, you can execute the Javac/java tool in any directory.

2. CLASSPATH environment variables. The role is to specify the class search path, to use the already written classes, the premise is to be able to find them, the JVM is through the classpth to find the class. We need to set the Dt.jar and Tools.jar in the Lib subdirectory of the JDK installation directory to classpath, of course, the current directory "." must also be added to the variable.

3. Java_home environment variables. It points to the JDK's installation directory, and software such as Eclipse/netbeans/tomcat finds and uses the installed JDK by searching for java_home variables.

Eclipse Configuration Environment variables

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.