sdkman is missing a specific java version
Asked Answered
U

3

20

I have SDKMAN 5.7.3+337 on an Ubuntu 18.10 which is listing these available versions for java:

     13.ea.17-open   > * 10.0.2-open         1.0.0-rc-12-grl
     12.0.1-zulu       * 9.0.7-zulu          1.0.0-rc-11-grl
     12.0.1-librca       9.0.4-open          1.0.0-rc-10-grl
     12.0.1-sapmchn      8.0.212-zulu        1.0.0-rc-9-grl
     12.0.1-open         8.0.212-amzn        1.0.0-rc-8-grl
   + 12.0.0-open         8.0.212-librca
     11.0.3-sapmchn    + 8.0.202-zulu
     11.0.3-zulu         8.0.202.j9-adpt
     11.0.3-amzn         8.0.202.hs-adpt
     11.0.3-librca       8.0.202-zulufx
   + 11.0.2-open         7.0.222-zulu
     11.0.2.j9-adpt      6.0.119-zulu
     11.0.2.hs-adpt      1.0.0-rc-15-grl
     11.0.2-zulufx       1.0.0-rc-14-grl
     10.0.2-zulu         1.0.0-rc-13-grl

while the same SDKMAN version on an Ubuntu 18.04.1 LTS (as WSL in Windows 10) shows:

13.ea.17-open     * 9.0.4-open          1.0.0-rc-11-grl
12.0.1-sapmchn      8.0.212-zulu        1.0.0-rc-10-grl
12.0.1-zulu         8.0.212-amzn        1.0.0-rc-9-grl 
12.0.1-open         8.0.212-librca      1.0.0-rc-8-grl 
12.0.1-librca     + 8.0.202-zulu 
11.0.3-sapmchn      8.0.202.j9-adpt
11.0.3-zulu         8.0.202.hs-adpt
11.0.3-amzn         8.0.202-zulufx
11.0.3-librca     + 8.0.191-oracle
11.0.2.j9-adpt      7.0.222-zulu
11.0.2.hs-adpt      6.0.119-zulu
11.0.2-zulufx       1.0.0-rc-15-grl
10.0.2-zulu         1.0.0-rc-14-grl
10.0.2-open         1.0.0-rc-13-grl
9.0.7-zulu          1.0.0-rc-12-grl

where 11.0.2-open is missing. Why this happens and how should I solve this?

PS: I already run sdk selfupdate and sdk update

Unlicensed answered 23/4, 2019 at 11:12 Comment(0)
U
22

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)

Unlicensed answered 23/4, 2019 at 11:28 Comment(5)
For not having the path issue when using a downloaded version, it would be better to use the sdk to install the local version as shown here (sdkman.io/usage#localversion)Maynord
This mostly worked for me, but I downloaded the MacOS openJdk package for Java 15, which matches the expected dir for Mac packages (ie., Contents/Home Contents/MacOS ). So I had to move things around so that the candidates/15.0.2-open dir contained the standard JAVA_HOME layout ( bin/ lib/ etc...)Hoitytoity
"so that the candidates/15.0.2-open dir contained the standard JAVA_HOME layout ( bin/ lib/ etc...)" - I'm pretty sure that's the way it's supposed to be, but is just a hunch.Unlicensed
For me, afterwards the status of the java version was local_only, and I had to $ sdk use java X.Y.Z for it to be installed.Brumbaugh
FYI I had to manually create symlinks to: $ ls -l ~/.sdkman/candidates/java/19.0.1-open/ total 0 drwxr-xr-x ... 19.0.1.jdk lrwxr-xr-x ... bin -> 19.0.1.jdk/Contents/Home/bin/ lrwxr-xr-x ... conf -> 19.0.1.jdk/Contents/Home/conf/ lrwxr-xr-x ... include -> 19.0.1.jdk/Contents/Home/include/ lrwxr-xr-x ... jmods -> 19.0.1.jdk/Contents/Home/jmods/ lrwxr-xr-x ... legal -> 19.0.1.jdk/Contents/Home/legal/ lrwxr-xr-x ... lib -> 19.0.1.jdk/Contents/Home/lib/ lrwxr-xr-x ... release -> 19.0.1.jdk/Contents/Home/releaseConsolidation
G
16

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

Gussiegussman answered 19/2, 2021 at 14:7 Comment(7)
Does anybody know why that is? I was surprised I didn't see java 14 listed there, but I am able to install thanks to your suggestion.Torchwood
Can you give me the command that you tried for installing java 14, I can not able to download that version @T.SPapagena
@Papagena I used: sdk install java 14.0.2.hs-adptTorchwood
one more thing @Torchwood when I search sdk list java I did not find version 14 there, how could you found it?Papagena
@sagarrI checked the available version number from here oracle.com/ca-en/java/technologies/javase/… and then I just constructed the sdkman version naming myself {java version}.{hs - hotspot}-{distribution adopt, etc.}Torchwood
But I get this mv: target '/home/darw/.sdkman/candidates/java/15.0.2-open' is not a directoryTaryn
FYI, this is because SDKMAN! keeps the outdated versions in their DB, but has them set as invisible.Varrian
S
9

The easiest way to install a version not listed by e.g. sdk list java is to just write sdk install java 11 then press the TAB key. This will initiate autocomplete which will give you an autocomplete list to choose from.

Disclaimer: this works for me on macos in a terminal running zsh.

Serajevo answered 15/5, 2022 at 8:17 Comment(2)
I have the same setup, mac with m1 and zsh. I needed ver11 from java.net but it wasn't listed, only versions 20 and 19. As a last resort I installed 19 but after I did that and I did sdk list java I saw that now it was listing also version 11?? Weird behaviour, but now I just installed 11 and it worked.Arbour
@Arbour Thanks for the info. If you can reproduce it, you may consider opening an issue on sdkman's github repo: github.com/sdkman/sdkman-cliHabsburg

© 2022 - 2024 — McMap. All rights reserved.