I have used a simple tool for many years to manage the development software I need on my Linux workstation:
The installation is very simple has highlighted on their home page:
curl -s "https://get.sdkman.io" | bash
A bit scary to be running a script that you download straight into a shell but you can do as you see fit to examine the script first if you prefer.
I use it to install Java, Gradle, Kotlin, Spark, VisualVM and it allows you to try a few other framework. You can even decided which Java vendor you want to use.
A big advantage is that it installs all these software in your home directory and it does not affect the system. You can also quickly switch from a version to another and that has proven very useful more than once.