How to maintain Multiple Java sdk in Mac OS

Hi Guys,

In this blog, we will learn how to manage multiple Java SDKs effectively on macOS.

1) List all the available Java SDKs on the operating system.

~ % /usr/libexec/java_home -v

/usr/libexec/java_home -verbose




2) Set or change Java

~ % export JAVA_HOME=$(/usr/libexec/java_home -v 22.0.2)


3) View the updated java version


~ % java -version


openjdk version "22.0.2" 2024-07-16

OpenJDK Runtime Environment (build 22.0.2+9-70)

OpenJDK 64-Bit Server VM (build 22.0.2+9-70, mixed mode, sharing)




3) View the updated java version


~ % which java


~ % where java

Comments

Popular posts from this blog

Google Assistant Implementation in Android application with app actions