Trouble updating to Java 8 JDK
What does your .bash_profile say? There should be a line:

export JAVA_HOME=`/usr/libexec/java_home -v 1.6`


You just have to change the Java version from 1.6 to 1.8 and then reload the system variables (. ~/.bash_profile). Tried this out changing between jdk7 and jdk6. So version 8 shouldn't be an exception.