Where Is the 'Sdk' Command Installed for Sdkman

Where is the `sdk` command installed for sdkman

OK. So I found it out. As @that-other-guy mentioned in the comment above, I used type -a instead of which, which showed me that it was a function defined.

Where does sdkman install packages?

I've checked it on my system. It should be located in $HOME/.sdkman/candidates/.

sdk: command not found

It seems it is not possible to install SDKMAN! once as root and that be available for all users. I guess each user needs to install it and then each users needs to install it's own version of Java, which is a pain if I manage one server and need several users to have the same configuration.

SDKMAN - Is it possible to download sdks manually for installation

I am able to make it work by copying the downloaded archive to ~/.sdkman/tmp folder and changing the name to what is expected by sdkman

For visualvm:

~/.sdkman/tmp$ cp /mnt/c/Users/user123/Downloads/visualvm_202.zip .
~/.sdkman/tmp$ mv visualvm_202.zip visualvm-2.0.2.bin

For micronaut:

~/.sdkman/tmp$ cp /mnt/c/Users/user123/Downloads/micronaut-1.3.5.zip .
~/.sdkman/tmp$ mv micronaut-1.3.5.zip micronaut-1.3.5.bin

How to find the file name sdkman is expecting:

  • Try to install SDK usually with sdk install visualvm 2.0.2
  • If downloading SDK is too slow, abort the installation process with ctrl + c
  • ls ~/.sdkman/tmp and you can see the filename sdkman is trying to download

Please suggest if there is any simpler and better approach

How to use SDKMAN! to install packages from within scripts

you need to source in ~/.sdkman/bin/sdkman-init.sh, like in

#!/bin/bash
. /home/alexw/.sdkman/bin/sdkman-init.sh
sdk install java 8u144-zulu

'sdk' is a bash function declared in sdkman-init.sh, and your first line (#!...) starts a new(!) shell.

hope that helps! weHe

SDKMAN local installation

This used to work in the past for me - not sure if it still applies.

Simply extract the archive to the relevant sdkman folder and tell sdkman to use it as the default version.

For example:

$ unzip -d ~/.sdkman/candidats/groovy ~/Downloads/groovy-2.4.12.zip
$ sdk default groovy 2.4.12 # sdk use ...

How to set gradle path after installing using sdkman

sdkman installs software only for your current user (placed under $HOME/.sdkman). When you login as another user you will not have access to them. sdkman has init scripts called from your .bashrc/.zshrc that will append to your PATH. On my account gradle is /Users/marvi/.sdkman/candidates/gradle/current/bin/gradle.

For a multi user install I would do a manual install. First option here: http://howtoprogram.xyz/2016/09/06/install-gradle-ubuntu-16-04/



Related Topics



Leave a reply



Submit