Dec 12, 2020

Multiple JDK on Windows

 Installation of JDK is straight forward for Windows, just download JDK and install.

There are situation where certain type of program require specific version of JDK and JRE. In such case you will have more then one version of JDK installed on your machine and you will have to switch JDK version based on the need of the program. 

Configure Java

Set up System Environment variable

JAVA_HOME = C:\Program Files\Java\jdk-11.0.8\bin

In Path variable append extra entry for JAVA_HOME

Path = %JAVA_HOME%

Check environment variable and Java in cmd

echo %JAVA_HOME% 

java -version


Switch JDK 

Just edit the JAVA_HOME system variable and point to new JDK location. You don't have to change Path variable.

JAVA_HOME = C:\Program Files\Java\jdk-1.8\bin


No comments:

Post a Comment