It suprises me that some fellow developers that still struggle installing some development kits like Java JDK, Maven. It might be a pain in the ass to find your right piece of software for yourLinux distribution. How many times did you had a bug, or you were missing some feature that is released in a newer version but yet it was not available in your repo?

 Especially when you need to be able to switch between versions because because of multiple projects you have to find a way to manage these multiple versions.

The moments when Maven could not build your project because you were using JDK8 instead of 11. I'm not only talking about Java, but also with tools like Maven, Gradle, Kotlin etc.

Background:
When installing Java JDK on Linux by using your package manager of your OS, you might encounter some difficulties. Finding the right version is one of the struggles, but if you install multiple versions, you have to tell your OS which version you prefer to use. You would do this by configuring the update-alternatives. Besides that, you have to modify your $JAVA_HOME environment variable. Everytime you want to switch versions, you have to configure update-alternatives and change your $JAVA_HOME. And everytime you are Googling how to switch those damn versions.

SDKMAN! comes to the resque!
"SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. It provides a convenient Command Line Interface (CLI) and API for installing, switching, removing and listing Candidates." SDKMAN

I am lazy. I am simple. I am using SDKMAN. Simply because the installation is just executing 1 line of code

$ curl -s "https://get.sdkman.io" | bash

The installation instructions are  here.

I mean, it is so easy. Do you want to know what versions of JDK you can install| 
Retrieve the list of available JDK.

gokhan@DESKTOP-0VOK5ER:~$ sdk list java
==== BROADCAST =================================================================
* 2019-06-24: Gradle 5.5-rc-4 released on SDKMAN! #gradle
* 2019-06-19: Kotlin 1.3.40 released on SDKMAN! #kotlin
* 2019-06-19: Springboot 2.1.6.RELEASE released on SDKMAN! #springboot
================================================================================
================================================================================
Available Java Versions
================================================================================
 Vendor        | Use | Version      | Dist    | Status     | Identifier
--------------------------------------------------------------------------------
 AdoptOpenJDK  |     | 12.0.1.j9    | adpt    |            | 12.0.1.j9-adpt
               |     | 12.0.1.hs    | adpt    |            | 12.0.1.hs-adpt
               |     | 11.0.3.j9    | adpt    |            | 11.0.3.j9-adpt
               |     | 11.0.3.hs    | adpt    |            | 11.0.3.hs-adpt
               |     | 8.0.212.j9   | adpt    |            | 8.0.212.j9-adpt
               |     | 8.0.212.hs   | adpt    |            | 8.0.212.hs-adpt
 Amazon        |     | 11.0.3       | amzn    |            | 11.0.3-amzn
               |     | 8.0.212      | amzn    |            | 8.0.212-amzn
 Azul Zulu     |     | 12.0.1       | zulu    |            | 12.0.1-zulu
               |     | 11.0.3       | zulu    |            | 11.0.3-zulu
               |     | 10.0.2       | zulu    |            | 10.0.2-zulu
               |     | 9.0.7        | zulu    |            | 9.0.7-zulu
               |     | 8.0.212      | zulu    |            | 8.0.212-zulu
               |     | 7.0.222      | zulu    |            | 7.0.222-zulu
               |     | 6.0.119      | zulu    |            | 6.0.119-zulu
 Azul ZuluFX   |     | 11.0.2       | zulufx  |            | 11.0.2-zulufx
               |     | 8.0.202      | zulufx  |            | 8.0.202-zulufx
 BellSoft      |     | 12.0.1       | librca  |            | 12.0.1-librca
               |     | 11.0.3       | librca  |            | 11.0.3-librca
               |     | 8.0.212      | librca  |            | 8.0.212-librca
 GraalVM       |     | 19.0.2       | grl     |            | 19.0.2-grl
               |     | 19.0.0       | grl     |            | 19.0.0-grl
               |     | 1.0.0        | grl     |            | 1.0.0-rc-16-grl
 Java.net      |     | 14.ea.2      | open    |            | 14.ea.2-open
               |     | 13.ea.26     | open    |            | 13.ea.26-open
               |     | 12.0.1       | open    |            | 12.0.1-open
               |     | 11.0.2       | open    |            | 11.0.2-open
               |     | 10.0.2       | open    |            | 10.0.2-open
               |     | 9.0.4        | open    |            | 9.0.4-open
 SAP           |     | 12.0.1       | sapmchn |            | 12.0.1-sapmchn
               |     | 11.0.3       | sapmchn |            | 11.0.3-sapmchn
================================================================================
Use the Identifier for installation:

    $ sdk install java 11.0.3.hs-adpt
================================================================================

 

For example we want to install OpenJDK 12.0.1

gokhan@DESKTOP-0VOK5ER:~$ sdk install java 12.0.1-open

Downloading: java 12.0.1-open

Repackaging Java 12.0.1-open...

Done repackaging...

Installing: java 12.0.1-open
Done installing!


Setting java 12.0.1-open as default.

 

To use java 12.0.1 as default:

sdk default java 12.0.1-open

 

List all available canidates:

gokhan@DESKTOP-0VOK5ER:~$ sdk list

================================================================================
Available Candidates
================================================================================
q-quit                                  /-search down
j-down                                  ?-search up
k-up                                    h-help

--------------------------------------------------------------------------------
Ant (1.10.1)                                             https://ant.apache.org/

Apache Ant is a Java library and command-line tool whose mission is to drive
processes described in build files as targets and extension points dependent
upon each other. The main known usage of Ant is the build of Java applications.
Ant supplies a number of built-in tasks allowing to compile, assemble, test and
run Java applications. Ant can also be used effectively to build non Java
applications, for instance C or C++ applications. More generally, Ant can be
used to pilot any type of process which can be described in terms of targets and
tasks.

                                                               $ sdk install ant
--------------------------------------------------------------------------------

...
...
...

 

Find more about the usage on the SDKMAN! website.

 

Unfortunately it does not provide NodeJS. You could use NVM for that