.zshrc: command not found: jenv
Asked Answered
W

3

5

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.

Weiman answered 29/10, 2020 at 21:24 Comment(2)
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.Fenestra
fwiw I did brew install jenv and brew uninstall jenv and the error stopped showing upMeson
G
1

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.

Glacier answered 30/1, 2023 at 19:46 Comment(0)
C
6

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.

Cosmic answered 30/10, 2020 at 4:54 Comment(1)
It was helpful. Also, to update and correct the path in ~/.zshrc I followed #11530590Truitt
G
1

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.

Glacier answered 30/1, 2023 at 19:46 Comment(0)
O
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
Occipital answered 6/10, 2022 at 21:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.