Currently JAVA_HOME and JDK_HOME variables are set by set-java-home.bash when Java version is specified by asdf. This might cause JAVA_HOME and JDK_HOME to be persisted even when Java version is not specified anymore (for example navigating out of directory with local .tool-versions file).
This PR clears JAVA_HOME when it is not configured via asdf to keep it in sync. Similar problem probably exists for other supported shells, but since I don't use these then I can't test any changes.
Currently
JAVA_HOME
andJDK_HOME
variables are set byset-java-home.bash
when Java version is specified by asdf. This might causeJAVA_HOME
andJDK_HOME
to be persisted even when Java version is not specified anymore (for example navigating out of directory with local.tool-versions
file).For example:
This PR clears JAVA_HOME when it is not configured via asdf to keep it in sync. Similar problem probably exists for other supported shells, but since I don't use these then I can't test any changes.