codespecs / daikon

Dynamic detection of likely invariants
http://plse.cs.washington.edu/daikon/
Other
214 stars 54 forks source link

`daikon.bashrc` Should Not Add JAVA_HOME to $PATH #493

Closed NateLevin1 closed 1 year ago

NateLevin1 commented 1 year ago

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, 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.

mernst commented 1 year ago

Sorry for the problem, and thank you for pointing it out. Your solution sounds like the right thing; could you please submit the patch?

Thank you!