You'll need to set up your environment so that Cassandra knows where to find the latest version of Java. To do this, set up your JAVA_HOME environment variable to the install location, and your PATH to include the executable in your new Java installation, as follows:
$ export JAVA_HOME=" /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home"$ export PATH="$JAVA_HOME/bin":$PATH
You should put these two lines at the bottom of your .bashrc or .bash_profile file to ensure that things still work when you open a new terminal.