30

I installed sdkman in my mac machine and after completion of installation steps and when I tried for sdk to install lazybones in my computer, I am getting error as "sdk command is not found". If anybody have any solution, please let me know.

sai krishna kota
  • 311
  • 1
  • 3
  • 3
  • 3
    Reading https://stackoverflow.com/questions/44988259/where-is-the-sdk-command-installed-for-sdkman?rq=1 I would say restart your terminal (or your mac) –  Jul 29 '17 at 19:18

8 Answers8

38

you should append those two lines inside your .bash_profile file.

Usually located in your $HOME Tap nano $HOME/.bash_profile and then append those two lines at the end the file using your prefered editor (nano,vim..):

# SDK Man replaced GVM. Using for Groovy, Gradle, and Maven Version Management
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

you can refer to this link: https://www.bonusbits.com/wiki/HowTo:Install_SDKMan_on_MacOS_or_Linux

  • 2
    I had sdkman installed and working for quite a while. Today it ran into error "-bash: sdk: command not found". Running the command above in terminal fixed it. Thanks. – Lal Apr 15 '18 at 15:01
  • Oh no no, don't add that to bash profile. These two lines, if installation is bad, tend to close immediately terminal session so the guy will never be able to login again. And this SDKMAN is piece of non working software, one of the worst setups I've seen. Untill they make it working with yum or apt-get no respect from my side. Caused me serious issues on corporate server. Lame ! – Peter Nov 23 '22 at 11:56
  • However - instead of curl -s, curl -k worked for me in the first step. Then other steps worked fine, except I had to check other downloaded scripts and replace -s to -k as I was getting "'SDKMAN_CANDIDATES_CSV=$(curl -s "${SDKMAN_SERVICE}/candidates/all")': command failed with exit code 60." -Give us YUM gentlement please ! – Peter Nov 23 '22 at 12:50
37

Very simple in case you use MAC & OH MY ZSH

step 1:

vim ~/.zshrc

step 2:(Add at the end of the file)

source ~/.bash_profile;

step 3:(Execution shell)

> source ~/.bash_profile

You can use sdkman : ➜ sdk

We periodically need to update the local cache. Please run:

$ sdk update

BINGO!!!

Freddy Mcloughlan
  • 4,129
  • 1
  • 13
  • 29
14

Try this,

Step-1:

curl -s https://get.sdkman.io | bash

Step-2:

source "$HOME/.sdkman/bin/sdkman-init.sh"
Satya
  • 416
  • 5
  • 7
  • Centos 7 - step gets an empty file. I had to get all stuff from GIT repo. This setup is a joke. Yum, apt-get looks more serious approach but that doesn't exist. – Peter Nov 23 '22 at 12:02
3

If you already installed SDK please close the terminal and open again.

if you haven't installed it open your terminal & write

curl -s https://get.sdkman.io | bash
Abhishek
  • 63
  • 2
1

Follow up from @niels's answer on win10, I got /home/<my_user_name>/.sdkman/bin/sdkman-init.sh:162: command not found: __sdkman_echo_debug because the find command was coming from windows/system32, as I do where find gives me:

where find
/cygdrive/c/Windows/system32/find
/usr/bin/find

So make sure you didn't mess up with Cgywin's default $PATH. By default, cygwin's bash has /usr/bin/ in front of windows's system32 folder.

Charles Chen
  • 21
  • 1
  • 3
1

I would like to add to the solution provided by @Bachiri Taoufiq Abderrahman.

But one needs to verify which shell he/she is using, run echo $0 to verify the name of the shell.

And based on if its zsh or bash edit ~./zprofile or ~/.bash_profile files.

And add the following lines

# SDK Man replaced GVM. Using for Groovy, Gradle, and Maven Version Management export SDKMAN_DIR="$HOME/.sdkman" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

Make sure that these are added at the end of the page or that there is no more entry in the file after this particular entry

Prajval Singh
  • 501
  • 3
  • 9
-1

If you have the problem at windows: On windows mostly the find-command isn't found. Add in .bashrc the following export PATH=/usr/bin:$PATH

this ensures that the linux find is used instead of the windows one.

niels
  • 7,321
  • 2
  • 38
  • 58
-1

I resolved it problem configuring the default version of gradle with it command:sdk install gradle && sdk default gradle