halcyon / asdf-java

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

Another fix for setting JAVA_HOME in `fish` shell #134

Closed CodingAnarchy closed 3 years ago

CodingAnarchy commented 3 years ago

133 updated to use the builtin realpath for the fish shell, but this failed to return directory (instead it returns the full path to the executable). This means that we need to use dirname twice or we will get errors like the following (note the duplication of bin/bin near the end of the path:

No `java' exists at ~/.asdf/installs/java/adoptopenjdk-11.0.8+10/bin/bin/java, please double-check JAVA_HOME.
CodingAnarchy commented 3 years ago

@halcyon My apologies, but my patch in #133 was missing a small change I had made to get it working on my local system. The resetting of the directory was fixed, but this is needed for the system to properly find the asdf installation of java.