"sdk command is not found " is coming the terminal
Asked Answered
S

8

32

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.

Serialize answered 29/7, 2017 at 18:58 Comment(1)
Reading #44988759 I would say restart your terminal (or your mac)Unthankful
E
45

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!!!

Exceed answered 21/9, 2020 at 15:13 Comment(1)
There are currently conflicts on Mac with M1 with brew and sdk, this solution doesn't help this because it forces bash to be used in zsh. In order for both to coexist, the following must be executed: echo 'source "$HOME/.sdkman/bin/sdkman-init.sh"' >> ~/.zshrc and source ~/.zshrc.Tola
C
39

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

Chevrotain answered 8/8, 2017 at 14:34 Comment(4)
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.Accelerator
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 !Irick
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 !Irick
Wanting to add to this. In my case, it appears that attempting to install sdkman with curl resulted in it concatenating those lines into ~/.zshrc at the bottom of the file. Issue is, the location I have set up is ~/.zsh/.zshrc. So worth a check. I stumbled across it by accident because I ran vi ~/.zshrc instead of my usual filepath. To avoid issues like this, it may be good to create a symbolic link there.Simile
M
20

Try this,

Step-1:

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

Step-2:

source "$HOME/.sdkman/bin/sdkman-init.sh"
Macrography answered 29/8, 2022 at 12:46 Comment(1)
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.Irick
C
4

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
Clearcole answered 16/8, 2020 at 15:44 Comment(0)
F
2

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.

Fortify answered 6/12, 2022 at 1:35 Comment(0)
Q
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

Qoph answered 7/1, 2023 at 9:24 Comment(0)
B
-2

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.

Brazilein answered 19/9, 2019 at 9:23 Comment(0)
O
-2

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

Osswald answered 11/12, 2021 at 4:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.