About clojure command searching for java order

The piece of code that search for the java executable in the clojure command, gives precedence to the System wide java command over the one in the JAVA_HOME.

Shouldn’t that be the opposite?

If you have JAVA_HOME set, the java command should respect that (so the clojure script is correct to try to find java first, and then use JAVA_HOME only if java is not on the path):

(! 564)-> env | fgrep JAVA

Tue Jun 18 10:34:10
(! 565)-> env | fgrep JDK

Tue Jun 18 10:34:14
(! 566)-> JAVA_HOME=$OPENJDK11_HOME java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)

Tue Jun 18 10:34:32
(! 567)-> java -version
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_192-b12)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.192-b12, mixed mode)

Tue Jun 18 10:34:37
(! 568)-> 

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.