On my Mac (El-Capitan), I have added the following command into my bash_profile file:
export JAVA_HOME="$(/usr/libexec/java_home)"
This perfectly sets the correct java_home environment var. However, on one of my machines I don't have java installed and I don't want to install java :).
I have a dotfiles repository, so on all of my machines I have the same .bash_profile file. Now the problem is that on the machine without Java, the command above outputs this:
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Now my question is: how can I get rid of the error / warning, without changing the meaning of the command?