JDK (multi-version) installation Note!

Source: Internet
Author: User

? Installing the JDK and JRE

? JDK configuration environment variables and tests

Install multiple versions of the JDK and switch

? The difference between the JRE under the JDK and the second installed JRE

Note the point:

1.JDK version needs to be 64-bit

2. Install JDK two installation prompts will appear during installation of the installation directory.

The first time is to install the JDK (which comes with the JRE, which is different from the second installed JRE, as explained later).

the second time is to install the JRE . It is recommended that all two are installed in a different folder in the same Java folder. ( cannot be installed in the Java folder root directory, JDK and JRE installed in the same folder will be error )

As shown in the following:

3. Next run the installation package, and the first step is to start installing the JDK. such as: I installed the JDK in ..../java_jdk1.8/jdk1.8 under:

4. The second step, start installing the JDK operating environment, I installed it in .../java_jdk1.8/jre8:

5. Configure environment variables after installing JDK computer → properties → advanced system settings → advanced → environment variables

System variables → new java_home variable.

Variable value fill in the JDK installation directory (I am E:\javaEdit\JDK\java_jdk1.8\jdk1.8)

The following path and classpath variables are the same for everyone's settings.

System variables → find Path variable → edit

Enter%java_home%\bin;%java_home%\jre\bin at the end of the variable value ;

(Note that the original path of the variable value at the end of there is no; number, if not, first enter; number and then enter the above code)

System variables → new CLASSPATH variable

Variable values are filled in .; %java_home%\lib;%java_home%\lib\tools.jar(Note that there is a point in the front)

6. Verify that the configuration is successfully run cmd input java-version (there are spaces between Java and-version)

If the version information is displayed, the installation and configuration are successful.

6.1 Further testing: input javaC -version , the correct output is:

(Note: the difference between java-version and javac-version:

Java-version shows the latest installed version of Java Javac-version shows you the configuration environment variable version of Java)

6.2 Further tests:

Create a new Notepad file under D, rename Hello.java and write the following code to save:

public class hello{
public static void Main (String []args) {
System.out.println ("Hello world!");
}
}

To the DOS Window command window directly enter D: to open the D-disk, and then enter the javac Hello.java and Java Hello command, the results are as follows to demonstrate the success of the configuration:

7. Install multiple versions of the JDK in the E:\javaEdit\JDK directory:

Both 1.6 and 1.7 can be installed to test successfully, such as:

JDK version switching: simply replace the java_home in the system environment variable with the installation directory of the JDK you want to switch to, such as in the 1.6 version: E:\javaEdit\JDK\java_jdk1.6\jdk1.6

8. Finally, thedifference between the JRE under the JDK and the second installed JRE is discussed:

When you install a JDK, two JRE is installed. If you are the default path installation, a JRE directory in C:\Program Files\java\jdk1.8.0_25\jre, one installed in C:\Program Files\java\jre8, i.e. Jre8 and jdk1.8.0_ 25 is in the same directory (Java).

Where C:\Program Files\java\jdk1.8.0_25\jre is the Java Runtime Environment under JDK development

C:\Program Files\java\jre8 is a client-independent Java runtime environment. If you are not in Java development, you need to install the runtime without installing the JDK.

Why C:\Program Files\java\jdk1.8.0_25\bin to be configured in the PATH environment variable, and C:\Program Files\java\jre8\bin does not have to be added to the PATH environment variable.

This article gives an explanation: the installation of JDK directory with the JDK and JRE folder for the resolution

Reference article: JDK installation and environment variable configuration (Baidu experience) Win7 How to uninstall the JDK (Baidu experience)

right|alston& Thinking Focus,Original is not easy, please respect original。

JDK (multi-version) installation Note!

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.