Installing and configuring multiple versions of the JDK under Windows

Source: Internet
Author: User

    1. Download the JDK that matches the system on the Oracle website as follows:

    2. 2

      To install jdk1.7 as an example, double-click Run Jdk-7u80-windows-x64.exe and click Next:

      (Note: Choose a directory with a file name without spaces when selecting the JDK installation directory)

    3. 3

      The installation screen appears and waits for the installation to complete:

    4. 4

      After the JDK installation is complete, the installation interface of the JRE appears, change the installation directory of the JRE, and click Next:

    5. 5

      The JDK installation was successful, click Close.

    6. 6

      According to the installation method of jdk1.7, install jdk1.8 and jdk1.8 respectively, the directory after the installation is complete

      END
Configuring Environment variables
    1. 1

      Right-click the computer, select Properties, select Advanced System settings, and create a new system environment variable:

      Variable name (N): Java_home

      Variable Value (V): JDK installation directory

      (e.g. C:\Application\Develop\Java\jdk\jdk1.7\jdk1.7.0_80)

    2. 2

      New system environment variable CLASSPATH:

      Variable name (N): CLASSPATH

      Variable Value (V):.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;

    3. 3

      Edit environment variable Path:

      Variable name (N): path

      Variable Value (V):%java_home%\bin;%java_home%\jre\bin;

      END
Test JDK installation Complete and switch JDK version
    1. 1

      Win + R, enter cmd, enter the Java command at the command prompt, as shown below:

    2. 2

      Enter the Javac command at the command prompt, which appears as follows:

    3. 3

      To view JDK version information, at the command prompt, enter the java-version command:

    4. 4

      To switch the JDK version, you only need to modify the corresponding Java_home value, such as switching to jdk1.8, just change the java_home value to C:\Application\Develop\Java\jdk\jdk1.8\jdk1.8.0_ 131. View the version of the JDK after switching:

Installing and configuring multiple versions of the JDK under Windows

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.