sdkman! How to manage pre-existing JDK? - Stack Overflow
sdkman is missing a specific java version - Stack Overflow
java - How to specify to install oracle jdk instead of openjdk in sdk cli on ubuntu 17.04? - Stack Overflow
how do you install arm jdks with sdkman?
Videos
You may need to re-source sdkman-init:
source ~/.sdkman/bin/sdkman-init.sh
When I was in your situation, just after "installing" local versions to sdkman, use worked, but list and current didn't show the local versions and env init didn't populate .sdkmanrc with the version I selected with use. Re-sourcing sdkman-init fixed these issues.
Posting for posterity.
OK, I should have tried harder. I installed Java 19 with sdkman then the command "sdk default java [my old version]" switches back as required.
It seems that downloading the missing version:
wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
then unpacking to:
~/.sdkman/candidates/java/
then renaming the extracted directory:
mv ~/.sdkman/candidates/java/jdk-11.0.2 ~/.sdkman/candidates/java/11.0.2-open
solves the problem.
PS: of course, you'll have to change ~/.sdkman/candidates/java/ to match your SDKMAN installation path (if not the default one)
Even if it is not listed, you can still install the version you require. At least, it worked for me with java 10.0.2-open, which, in my case, did not show up. Give it a try and run the command sdk install java 11.0.2-open
Another way.
You can install any version of java locally (use any way you want to do the local installation), and then register this installation using this command:
sdk install java 17-zulu /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
Take a look at SDK man Local Instalation
You can type sdk ls java and see which versions are available.
At the moment I see 8u141-oracle in the list. So you can install it by sdk i java 8u141-oracle
Just for anyone stumbling upon this answer: You can still download Oracle JDK and extract it manually in the appropriate folder. After that you can use all the sdkman commands like if it was installed automatically.
Extract Oracle JDK to ~/.sdkman/candidates/java/8.0.241-oracle and activate using sdk use java 8.0.241-oracle.
2021 Edit:
You no longer need to install/extract the manually downloaded binaries in the .sdkman folder. Just use local-path and provide the path where the binaries reside, e.g.
sdk install groovy 2.4.13-local /opt/groovy-2.4.13