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

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

A step-by-step guide to install parallel Java versions on any UNIX based System

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

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

10 Best Ubuntu-based Linux Distributions

Ubuntu is arguably one of the most popular and widely-used Linux distribution owing to its classic UI, stability, user-friendliness, and a rich repository that contains over 50,000 software packages. Furthermore, it comes highly recommended for beginners who are trying to give a shot at Linux.

How to Install Microsoft Teams on Ubuntu 20.04

In this tutorial, we will show you how to install Microsoft Teams on Ubuntu 20.04 machine. we can install teams using Debian installer file or by adding microsoft repository.

How to Install Java on Ubuntu, Windows, and MacOS

What is Java? Java is considered one of the most popular programming languages. Java is a typed object-oriented programming language developed by Sun

How To Install Oracle Java 8 in Ubuntu 16.04

How To Install Oracle Java 8 in Ubuntu 16.04. Oracle’s Java 8 is a programming language that creates many of the applications and websites in use today. Its ubiquitous and stable nature makes it a favorite amongst Google and Android developers for the last 20 years.