Never stop learning, because life never stops teaching.


Within omz (oh-my-zsh) or zsh in the WSL runtime of Windows, sometimes you’ve installed sdkman in one terminal. The sdk worked fien, however when you open a new terminal and try to run sdk command, you’ll get following error:

sdk vesrion

zsh: command not found: sdk

Error details & solutions

The root cause is the 1st installation failed to setup sdk init variables into system envrionment. This is related to special requirement in omz .

omz using following structure to save your personal environment varaibles, i.e.


In short, omz will scan and find any user customized variables under folder custom. So you can add your own file , e.g. obama.zsh or update the default example.zsh.

So you’d add following line into above file.

source "/home/YOUR_USER_NAME/.sdkman/bin/"

Then run

sdk vesrion

You’ll find your favorate sdk back to working now.

Similar error

After installation of omz you’ll find some settings may stop working as well, such as following errors:

  • Could not connect to on “sudo apt update”
  • cann’t connected or fatal error

This is similar to above reason. If you are running behind corporation firewall, your HTTPS proxy were setup for bash but now you need to add it to omz and zhs. Here are some samples:

export http_proxy=
export https_proxy=
export HTTP_PROXY=
export NO_PROXY=localhost,