Why Java configures environment variables and how to configure environment variables

Source: Internet
Author: User

Before the environment variable is configured, executing the Java file with CMD requires that the Java executable be indicated, otherwise it will not run.

The environment is configured to facilitate the execution and control of Java programs without having to switch the executable directory.

The environment variable is to let the system directly find the executable file according to the parameters of the environment variable.

The difference between a system variable and a user variable

user variables are affected by the current user, and system variables have an impact on all users. affect other users in order to make some changes to yourself. So to set user variables, avoid affecting his users.

If all two are set, the configuration of the system variable is preferred.

Steps to configure environment variables:

First step: My Computer right -- Property --- advanced system settings Step Two: System Variables - new --java_home- directory of the JDK you installed --c:\program files\java\jdk1.8.0_73 The third step: the system variable --- new --classpath, the value is:.; %java_home%\lib;%java_home%\lib\tools.jar Notice that there is a point ahead. Fourth Step: Select the system variable ---path-- edit -- Add the following code at the end of the Path :%java_home%\bin;%java_home%\jre\bin, Note Be sure to split the semicolon before adding it. Java-version detect if the installation is good!

Why Java configures environment variables and how to configure 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.