Home  >  Article  >  Java  >  What are environment variables? The role of environment variables

What are environment variables? The role of environment variables

零下一度
零下一度Original
2017-06-25 10:36:567025browse

1 Overview

1. What are environment variables?

Environment variables are the concept of the operating system, which refer to the variables required for the operation of the operating system and exist as the environment of the operating system.

2. The role of environment variables

#To understand the role of environment variables, you must first understand the background of environment variables.

We usually execute the application by clicking on the application executable file. How to execute the application by entering commands on the DOS command line? The operating system provides a search mechanism. It searches the current directory first. If the application does not exist in the current directory, it continues to search for environment variables. The environment variable contains the access path of the application. After it is found in the environment variable, the application is executed. program.

Environment variables provide a way for one application to call another application.

3. Environment variable category

Since the operating system divides information into two levels according to user categories, information for all users and information for specific users Information about specific users, so environment variables are also divided into two levels: for all users and for specific users.

The configuration in user variables is only valid for the current user, and the configuration in system variables is valid for all users accessing the machine. Since system variables are configured with a lot of information closely related to system operation, improper operation may cause the system to run abnormally, so it is recommended to configure it in user variables, which is safer.
Configuration process:
Create a new variable in the user variables, the variable name is path (not case-sensitive, lowercase is recommended), the variable value is the application executable The access path to the file. In addition, the process of some applications calling another application is to search for a variable with a specified name from the environment variable, obtain its value, and then execute the application. Therefore, it is necessary to configure an environment variable with a specific name, and the variable name is fixed, such as JAVA_HOME\CATALINA_HOME etc., the variable value is the installation path of the application.

The above is the detailed content of What are environment variables? The role of environment variables. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn