.zshrc: command not found: jenv

9.9k views Asked by At

I recently followed the steps to install jENV and Corretto-8. Unfortunately now whenever I open a new terminal I see the following:

Last login: XXXXXXX
/Users/username/.zshrc: command not found: jenv
/Users/username/.zshrc: command not found: jenv

Does anyone know how to fix this? I am truly at a loss.

3

There are 3 answers

0
Jean Suarez On BEST ANSWER

You might have installed it using MacOS brew and did this as well:

$ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile

$ echo 'eval "$(jenv init -)"' >> ~/.bash_profile

Now, you will have a duplicate command in your bash. Remove those two lines in your bash and you should be good.

1
Blaine On

This problem is likely occurring because jenv has not been added to your PATH before jenv init runs. Look at your .zshrc file and ensure the jenv section looks like this

export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"

Also, be sure that you don't have multiple jenv sections since the installation instructions for Zsh are not re-runnable. If you accidentally ran the instructions for Zsh twice, you will find two jenv sections at the end of your .zshrc file and you should delete one of them.

0
Danny Steinbrecher On

Today I was running into the same problem. I installed jenv via brew but it showed every time: "command not found".

The solution was, that jenv wasn't linked. So I run the following command and everything worked after that:

brew link jenv