java-Environment variables

Source: Internet
Author: User

Many students do not understand the environment variable exactly what is the specific use? Here fung for the students who are not quite clear about.

First we open the location of the environment variable, and here we take the WIN10 system as an introduction

In the desktop mail properties, the following

Then click Advanced System Variables

Then click on the environment variable

And then you can see the specific setup interface for the environment variable.

, environment variables are divided into user variables and system variables. System environment variables, which work for all users, and user environment variables only work for the current user, this is the two point gap. Of course, as a development, your java_home can also be configured into user variables.
.

Well, here's the point, let's see what the variables inside the WinDOS mean,

A variable is a quantity of meaning that has a relatively different value in a different environment but has the same convention in all environments. These variables, can be entered in the Start menu-run, such as input%systemroot%, the system will open the C:\WINDOWS directory directly .

Let's test it out:

First I define a user variable with a value pointing to a picture:

Hint: Add the variable must click OK to save, otherwise invalid.

Let's test this, in the Run command, enter whether the variable will open the photo, Win+r call run:

Look, open this picture.

Here I believe that we are not confused about the environment variables, the following Ah Feng again introduce our common Path variable:

The path variable is actually dos previous internal commands that Windows then used to date. When running a command, a command or file cannot be found locally and will be found in the directory of the Declaration. 
For a Java installation example:

If you want to execute this command, you must go to this folder, or you will get an error when executing commands in a folder other than this one.

We go to the folder execution command (no problem at all)

One more example:
Let's simply compile a Java file:
C:\Users\Lenovo\Desktop\test\Demo.java

Then a wind's approach is:

If you want to compile a file that is not a bin directory, you need to specify the full path of Javac, is not very troublesome ah. That's why we're configuring Java_home. Friendly tip: This is why some editors need to java_home. Of course, some editors are not configurable because they point to the directory and the following is the JDK configuration of idea

java-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.