Is it possible to set the JAVA_HOME env in El Captitan? I am unable to set the JAVA_HOME environment variable osx. I added the following line to my .bash_profile

export JAVA_HOME=`/usr/libexec/java_home`


and sourced it afterwards; yet when I printenv or attempt to echo it, I see nothing in Terminal.
The only way I got this to work was by setting this environment variable in the .bashrc file, which incidentally, isn't created in the users home directory by default.
Thanks to patrix's comments on my question which led to this solution.