Closed xenoterracide closed 1 year 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"
ASDF itself works for me, this problem is exclusive to the Java plugin. I was able to install and configure nodejs just fine.
If it helps: I have this problem on an M1 mac.
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"
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
asdf
is installed with brew
zsh
(https://ohmyz.sh/)asdf install java openjdk-19.0.1
/usr/libexec/java_home
returns /opt/homebrew/Cellar/openjdk/19/libexec/openjdk.jdk/Contents/Home
(not sure if relevant, but added to clarify this as well)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"