If you are a Java developer, you may need to install multiple Java versions on your machine. You may use Java8 or Java11 in your project, but want to learn newer versions of Java. Or maybe you are working on two different projects where two different versions of Java are used.

One way to achieve this is to install multiple Java versions and configure different Java versions manually. In that case, you have to modify a few environment variables when you need to switch your Java version. The other elegant and convenient way is to use the SDKMAN.

SDKMAN is a Software Development Kit Manager for managing parallel versions of multiple Software Development Kits on most Unix based systems. It allows us to install, remove, switch and list candidate versions of different SDKs including Java (e.g., JDK, Ant, Dotty, Gradle, Scala, and many more).

Here I will show how to manage multiple Java version on your UNIX based machine using SDKMAN. By reading this article, you will learn the following:

  • Install SDKMAN
  • List candidate JDKs using SDKMAN
  • Install multiple candidate JDKs using SDKMAN
  • Switch candidate JDKs using SDKMAN
  • Remove/Uninstall JDK using SDKMAN

The instructions are valid for most of the UNIX based operating systems including MacOS, any Linux OS (Ubuntu, Debian, MINT, Manjaro, OpenSUSE), FreeBSD, Solaris, Cygwin.

#java #linux #macos #ubuntu #programming

Install and run multiple Java versions on Linux and MacOS using SDKMAN
1.45 GEEK