This blog contains an overview of how a computer installs different versions of the JDK. Develop Java do not install JDK you play a yarn.
Let's get started!
Start with two different versions of the JDK from the official website.
Advanced Official Website: https://www.oracle.com/index.html
Follow the 1, 2, 3, 4 steps above to enter this page
Click Downloads to enter the following page has now been updated to the JDK10, but is not recommended to use. Stability to be determined. Drag the page down to see the following page. Here you can click on the historical version of the JDK download enter our here to choose Jdk8 and Jdk7 to download and start our topic today:
I'm downloading these two versions.
Click Install
Click Next to enter
Here we can change the installation path: Mine is installed in the Develop folder under the D disk of my computer:
Note: The path to the installation development tool does not have spaces, and the kanji
Click Confirm to return to the page just below:
Click Next to install, and then complete the installation. However, it is cumbersome to compile Java files every time we go into the installation path to start compiling. As shown in the following:
To solve this problem, we can configure the following environment variables as follows: a) Right-click on My Computer and select Properties to enter this page:
b) Select the advanced system configuration and go to the following page:
c) Click on the environment variable to go to the following page:
d) Click on the new system variable, which I have previously configured. I'll just click on the editor to see it for you:
Configure Java_home First
If the installation path is the same as me and the JDK version is the same as me, I can configure the following values:
Variable name: java_home
Variable Value: D:\develop\Java\jdk1.7.0_80
In the configuration classpath
Because you want to configure two versions of the JDK, the variable values are configured as follows:
Variable name: CLASSPATH
Variable value:.;
Note: The value of the variable "." and ";" is the English point and the seal number!!!
In configuring path, such as:
The value of the variable is:%java_home%\bin;%java_home%\jre\bin;
Configuration is complete, click OK to complete, in the DOS command to test if there is no installation completed, as follows:
Installation is complete.
JAK8 is installed as described above, then configure the environment variables as follows:
Variable name can be casually up, I use the java_home8 here, the address is installed JDK8 location.
Also in path configuration. This configuration should be preceded by the JDK7 configuration as follows:
The value of the variable is:%java_home8%\bin;%java_home8%\jre\bin;
The total value of the configuration is:%java_home8%\bin;%java_home8%\jre\bin;%java_home%\bin;%java_home%\jre\bin;
Because I have this value is all configured in front, so the following to seal the number. Then test it and basically get it done.
This way our computer installs two different versions of the JDK, and the switch is as long as the path is changed.
Just learn Java, do not use any of the big development tools. Use Notepad to beat the code. To remember some key words.
First knowledge of Java