This causes MacOS users to be unable to switch Java versions. On MacOS, the java executable is "special", because it automatically detects the correct executable to use based on JAVA_HOME.
Because daikon.bashrc overwrites $PATH to put its inferred JAVA_HOME first, the java bin of the inferred version will always be used, and the "special" MacOS executable will not be run, thus preventing switching Java versions.
The best solution to this is likely to only add JAVA_HOME to $PATH if not on Darwin. I'm willing to submit a quick PR for this if that solution sounds good.
On this line of the
daikon.bashrc
script, the JAVA_HOME variable is added to $PATH.https://github.com/codespecs/daikon/blob/169f2dab1d5d214591e74785b403517b01c25846/scripts/daikon.bashrc#L61
This causes MacOS users to be unable to switch Java versions. On MacOS, the
java
executable is "special", because it automatically detects the correct executable to use based on JAVA_HOME.Because
daikon.bashrc
overwrites $PATH to put its inferred JAVA_HOME first, thejava
bin of the inferred version will always be used, and the "special" MacOS executable will not be run, thus preventing switching Java versions.The best solution to this is likely to only add JAVA_HOME to $PATH if not on Darwin. I'm willing to submit a quick PR for this if that solution sounds good.