How to install Java version manager on Ubuntu 20.04

Overview:

Jabba - is a version manager tool for Java. It eases the process of installation and switching between different versions of the Java runtimes.

Installation:

  1. Export the latest Jabba version:
    export JABBA_VERSION=0.11.2
    
  2. Download and run the installation script (modifies rc files):
    curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh
    
  3. Optional. To skip modification of rc files use -skip-rc flag:
    curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash -s -- --skip-rc && . ~/.jabba/jabba.sh
    
  4. Confirm the installation:
    jabba --version
    

Basic commands:

  1. To list available remote versions of Java runtime to download and install:
    jabba ls-remote
    
  2. To download and install specific version of Java (openjdk@1.11.0-1):
    jabba install openjdk@1.11.0-1
    
  3. To list current installed versions of Java on your system:
    jabba ls
    
  4. To uninstall specific version of Java:
    jabba uninstall openjdk@1.11.0-1
    

Notes:

  1. The rc at the end of a file is related to the phrase "run commands"; its use derives from the /etc/rc. * files used to start most Unix systems. The rc suffix is commonly used for any file that contains startup information for a program.
  2. Jabba is useful in many cases. One such case is when you need to install Jenkins on your system, which requires specific versions of OpenJDK platform.

Reference:

  1. In Unix, what does rc at the end of files like .newsrc mean?
  2. Jenkins install on Ubuntu/Debian