find where JAVA_HOME is set code example
Example 1: find where JAVA_HOME is set
grep JAVA_HOME /etc/environment /etc/bash.bashrc /etc/profile.d/* /etc/profile
Example 2: find java home
/usr/libexec/java_home
grep JAVA_HOME /etc/environment /etc/bash.bashrc /etc/profile.d/* /etc/profile
/usr/libexec/java_home