Functions of Java environment variables

Source: Internet
Author: User

1. PATH environment variable. The role is to specifyCommand search path(Javac/Java/javadoc)When executing a command under shell, it will go to the path specified by the PATH variable to check whether the corresponding command can be foundProgram. We need to add the bin directory under the JDK installation directory to the existing PATH variable. The bin directory contains frequently used executable files such as javac/Java/javadoc waiting, after setting the PATH variable, you canAny directoryAnd java.
2. classpath environment variable. The role is to specifyClass search pathTo use the classes that have already been compiled, the premise is that you can find them. JVM uses classpth to find classes. We need to set DT. jar and tools. jar in the Lib subdirectory under the JDK installation directory to classpath. Of course, the current directory "." must also be added to this variable. (Therefore, when you need to import a class, you will have settings on classpath. You can find the class name to import in the path)
3. java_home environment variable. It points to the JDK installation directory, Eclipse/netbeans/TomcatThe software is to find and use the installed JDK by searching the java_home variable.

 

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.