[toc]

Since you need to use multiple JDK versions, how do you install multiple JDK versions on one computer

= =Of course, if you only need to install one JDK, this article is for you. Just put the JAVA_HOME value in the directory where you installed the JDK= =

First, install different JDK versions. I installed it on disk D. I installed versions 8 and 11

2. Configure system environment variables

1. In the Control Panel, go to System > Advanced System Settings > Environment Variables.

2. Add JAVA_HOME and Path (JDK 1.5 or later does not need to set the classpath variable)

JAVA_HOME: Set JAVA8_HOME, JAVA11_HOME, and JAVA_HOME. Set JAVA8_HOME and JAVA11_HOME to JDK installation paths.

Enter %JAVA_HOME% in the JAVA_HOME variable value, so that you can add or delete java8/11_HOME without changing JAVA_HOME.Copy the code

4. Path: If Path exists, click Edit to add %JAVA_HOME%\bin

3. Open the CMD window and enter Java -version to display the version number.

Four, then restart the computer, OK!