Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shims not updated after upgrading #394

Open
udalrich opened this issue Mar 27, 2023 · 3 comments
Open

Shims not updated after upgrading #394

udalrich opened this issue Mar 27, 2023 · 3 comments

Comments

@udalrich
Copy link

I recently did a brew upgrade, which updated jenv from 0.5.2 to 0.5.6. This caused most of my java-related command to fail with

/Users/me/.jenv/shims/java: line 21: /usr/local/Cellar/jenv/0.5.2/libexec/libexec/jenv: No such file or directory

Based on jenv help, it appeared that jenv rehash might be what I wanted to do, but that also failed:

$ jenv --version
jenv 0.5.6
$ jenv rehash
jenv: cannot rehash: /Users/me/.jenv/shims/.jenv-shim exists

At this point, I renamed .jenv-shim to see if that would fix the problem. jenv rehash did not report an error, and java --version and mvn install (with the maven plugin installed) seem to work now.

So I think I resolved the problem, but it required moving around files that feel like they are internal files that I shouldn't be touching and guessing at what the solution is.

I think at a minimum, jenv rehash needs to be modified to work when the shim file from an older version is present.

If there is a brew post-install hook that you control, running (the fixed) jenv rehash from that would also be a good idea. I am not familiar with the details of how brew installs things, so I have no idea how reasonable the post-install hook is.

@skobow
Copy link

skobow commented Apr 4, 2023

Got the exact same issue.

@dnishiyama
Copy link

I had the same issue and this resolved it. Thank you so much!!

@tmendenhall
Copy link

Thank you for documenting both the problem and the solution... a post install hook to rebuild the hash would be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants