halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
466 stars 86 forks source link

Missing lib/utils.bash #177

Closed xenoterracide closed 1 year ago

xenoterracide commented 2 years ago
asdf install java corretto-8.322.06.1
/Users/me/.asdf/plugins/java/bin/install: line 3: /Users/me/.asdf/lib/utils.bash: No such file or directory
❯ asdf info
OS:
Darwin 5c52309d33e3 20.6.0 Darwin Kernel Version 20.6.0: Wed Jan 12 22:22:42 PST 2022; root:xnu-7195.141.19~2/RELEASE_X86_64 x86_64

SHELL:
zsh 5.8 (x86_64-apple-darwin20.0)

ASDF VERSION:
v0.9.0

ASDF ENVIRONMENT VARIABLES:

ASDF INSTALLED PLUGINS:
java                         https://github.com/halcyon/asdf-java.git master b0341fd
aboy021 commented 2 years ago

I had a similar issue.

In my case it was because the plugin install scripts are written for bash, and I use fish (and sometimes zsh) as my shell.

The fix for me was to create a .bash_profile to initialise path information and this line for setting the ASDF_DIR:

set ASDF_DIR "$(brew --prefix asdf)/libexec"
xenoterracide commented 2 years ago

ASDF itself works for me, this problem is exclusive to the Java plugin. I was able to install and configure nodejs just fine.

breucode commented 2 years ago

If it helps: I have this problem on an M1 mac.

jmfayard commented 2 years ago

I can confirm that the java plugin doesn't work with Fish And that it can be fixed with this diff inspired by @aboy021

# file: .asdf/plugins/java/bin/list-legacy-filenames
# shellcheck source=/dev/null
+ export ASDF_DIR="$(brew --prefix asdf)"
source "${ASDF_DIR:-$HOME/.asdf}/lib/utils.bash"
natterstefan commented 2 years ago

I have a similar issue on my M1 Mac:

/Users/xxxxxxx/.asdf/plugins/java/bin/list-legacy-filenames: line 3: /Users/xxxxxxx/.asdf/lib/utils.bash: No such file or directory
robsonpeixoto commented 1 year ago

The homebrew already explain what should be done brew info asdf:

==> Caveats
To use asdf, add the following line (or equivalent) to your shell profile
e.g. ~/.profile or ~/.zshrc:
  . /home/linuxbrew/.linuxbrew/opt/asdf/libexec/asdf.sh
Restart your terminal for the settings to take effect.

But if you are a https://github.com/asdf-community/asdf-direnv user, I suggest the solution:

export ASDF_DIR="$(brew --prefix asdf)/libexec"
export ASDF_DATA_DIR="$HOME/.asdf"