Why do environment variables have to be set for environment variables?

Source: Internet
Author: User

For example, if you want to execute the Java command, you do not set the environment variable path including your JDK installation path, where the system goes to find your Java.exe file.
If you execute a command, the system cannot find the corresponding. exe in the current folder, then the system will go to the path contains the paths to find out if you can know the corresponding. exe, once found the first corresponding. exe to run the command, the other path is not found. If you can't find it, you'll see a "system can't find a command" prompt.
Other environment variables are used just for storing information, which can be used by the system or used by your application.

Environment variables can be considered as global variables of a computer
such as Java_home, can be accessed through the command line after definition, such as the DOS command line input echo%java_home%, you can view the value of the environment variable. Similarly Unix can be viewed under the command line using the Echo $JAVA _home.
These variables are referenced in the program, in the same way as in the command line, and can be accessed with% variable name% (Windows) or variable name (Unix).

Why do environment variables have to be set for environment variables?

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.