Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sdkman is missing a specific java version

Tags:

java

sdkman

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

like image 531
adrhc Avatar asked Apr 23 '19 11:04

adrhc


People also ask

Where does Sdkman install Java?

The installed SDKs are stored in the SDKMAN! directory which defaults to ~/. sdkman/candidates. Therefore, the currently selected version of Java will also be available as current in that directory.

Which Java JDK should I use?

Java SE 11 OR 17 remains the preferred production standard in 2022. While both 9 and 10 have been released, neither will be offering LTS. Since it's first release in 1996, Java has maintained a reputation for being one of the most secure, reliable, and platform independent languages for computer programming.


3 Answers

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 default one)

like image 58
adrhc Avatar answered Oct 05 '22 11:10

adrhc


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

like image 20
jvacaq Avatar answered Oct 05 '22 11:10

jvacaq


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.

like image 45
Erik Zivkovic Avatar answered Oct 05 '22 09:10

Erik Zivkovic