21

When using sdkman on uBuntu 17.04, I do not see an option to install the oracle jdk. How to specify to install oracle jdk using sdkman on uBuntu 17.04?

$sdk list java
 ===================================================================
 Available Java Version
 ===================================================================
 > * 8u131-zulu                                                                    
     7u141-zulu                                                                    
     6u93-zulu 


 ===================================================================
 + - local version
 * - installed
 > - currently in use
 ===================================================================
$  
Rishikesh Darandale
  • 3,222
  • 4
  • 17
  • 35

3 Answers3

16

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

Kirill
  • 6,762
  • 4
  • 51
  • 81
12

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

JSamir
  • 1,057
  • 1
  • 10
  • 20
  • 1
    How do you that for the Mac? There is only a dmg package available, not a zip, which one should I use? I tried 1 of the linux tar zips, but it doesn't work (Eclipse doesn't recognize it) – edbras Dec 20 '20 at 11:52
  • 1
    @edbras I would install the oracle jdk with the dmg file, look up the location where it is installed and symlink to the appropriate sdkman candidates folder. I think this is the only way because I am not aware of a way to tell sdkman *where* something is installed. There is only the one default install location. – JSamir Jan 26 '21 at 02:46
  • 2
    This should be the top and accepted answer...and I really appreciated it. Now I can still use the version management SDKMAN provides with Oracle java. Splendid :) – robquinn Mar 22 '21 at 11:23
  • Works fine with Java 11, this should be the accepted answer :) – Karim Sonbol Aug 31 '21 at 15:06
  • This script helped me for the first part https://gist.github.com/smola/b1332103514a7834cabca6af7bb09ceb – Foreever Oct 19 '21 at 21:41
11

Currently Oracle JDKs has finally been pulled out from SDKMAN due to some legal issues. The legal issues are explained over here

They have decided to introduce a lot of OpenJDK implementations like Azul Zulu, Azul ZuluFX for those who need JavaFX along with it. Please check with sdk ls java to find out what more are supported as of now.

Joseph T F
  • 801
  • 1
  • 7
  • 19