3

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.

shellter
  • 36,525
  • 7
  • 83
  • 90
user
  • 651
  • 10
  • 22
  • presumably, the jENV & Corr install created some of their own directories, or there is a log file that you could search? Try running `find /some/dir/for/jENV -name jENV -ls`? or `find $HOME ...` or `find /usr/local ...` ? Figure out where the file was created, and then change the configuration of jENV & Corr. to include that path in its setup information. Look for errors in the install log. Running out of ideas. Good luck. – shellter Oct 30 '20 at 04:30
  • 1
    fwiw I did `brew install jenv` and `brew uninstall jenv` and the error stopped showing up – Bauhaus May 20 '21 at 06:32

3 Answers3

3

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.

Blaine
  • 652
  • 8
  • 11
  • It was helpful. Also, to update and correct the path in ~/.zshrc I followed https://stackoverflow.com/questions/11530090/adding-a-new-entry-to-the-path-variable-in-zsh – Iqra Abdul Rauf Oct 07 '21 at 18:37
0

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
0

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.

Jean Suarez
  • 126
  • 1
  • 3