In case you upgraded to OS X Yosemite and your JAVA_HOME variable in bash_profile no longer works, change/add the following:
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
Then, run source ~/.bash_profile and it should work from there.
In case you upgraded to OS X Yosemite and your JAVA_HOME variable in bash_profile no longer works, change/add the following:
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
Then, run source ~/.bash_profile and it should work from there.