How to configure Java environment variables

Source: Internet
Author: User

How to configure Java environment variables
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

Java environment variable configuration:

setting of the 1.java_home variable

Settings for 2.Path variables

Settings for 3.Classpath variables

Of course, before we do, we need to download the Java SDK jdk

.

JDK Download
  1. 1

    "Baidu Search ' jdk ', enter the first article.

    .

  2. 2

    "" In downloads select Java download to enter Java download list

    .

  3. 3

    "" Click on Accept License agreement, select the Windows section to download the installation package.

    .

  4. 4

    Once downloaded, go to the folder and double-click the application to install as prompted until the installation is complete.

    .

  5. 5

    "" To test if the JDK was successfully installed, search for cmd in start and enter "Java-version".

    . END

Java_home variable Settings
  1. 1

    First, right-click Computer to go to properties and select Advanced system settings.

    .

  2. 2

    Click on "Environment variables" in "Advanced" to enter the environment variable editing interface.

    .

  3. 3

    In the "System variables" below, there is no java_home variable, then we need to click "New"

    .

  4. 4

    Variable name input: Java_home

    The value of the variable refers to the actual installation path (for example, the path of the small part is: C:\Program files\java\jdk-9).

    Finally click OK.

    . END

Path variable settings
    1. 1

      Also in "System variables" we can see that the path variable already exists, then we just need to click "Edit" to enter the PATH variable edit

      .

    2. 2

      Variable name unchanged, variable value changed to "%java_home%\bin;%java_home%\jre\bin;", finally click OK.

      . END

Classpath Variable Settings
  1. .

  2. 2

    Variable name type "Classpath"

    Variable value type ".; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; 】

    Be careful not to omit the symbol from the variable value, and then click OK.

    . END

Test environment configuration is successful
    1. 1

      After you complete the above three variables configuration, do not forget to click OK one step at a.

      Similarly, search for "cmd" in "Start".

      Then, type "java" and "Javac".

      A message appears stating that the configuration was successful.

      .

How to configure Java 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.