https://github.com/halcyon/asdf-java/pull/114 seems to have broken symlink handling for JAVA_HOME resolution on Linux. The cd -P workaround does not handle when the file itself is symlinked vs. the directory.
You can see that realpath /usr/bin/java works, but the cd -P workaround for OSX returns the incorrect path.
$ asdf which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 37 May 16 2020 /usr/bin/java -> /usr/lib/jvm/default-runtime/bin/java*
$ realpath /usr/bin/java
/usr/lib/jvm/java-11-openjdk/bin/java
$ echo $( cd -P "$( dirname /usr/bin/java )" && pwd )
/usr/bin
https://github.com/halcyon/asdf-java/pull/114 seems to have broken symlink handling for
JAVA_HOME
resolution on Linux. Thecd -P
workaround does not handle when the file itself is symlinked vs. the directory.You can see that
realpath /usr/bin/java
works, but thecd -P
workaround for OSX returns the incorrect path.Here is
set-java-home.zsh
run with debugging