Uninstalling Java 6 to replace with Java 8
If you want to remove Java 6... From How to properly uninstall Java 6 on OSX?, do the following:


  Remove the "system" JVM installed and maintained by Software Update

% sudo rm -rf /System/Library/Java/JavaVirtualMachines/1.6.0.jdk

  
  Remove any Java Developer Previews

% sudo rm -rf /Library/Java/JavaVirtualMachines/1.6.0*.jdk

  
  Do NOT remove any content in the JavaVM.framework. Those items are
  required by Java 7, 8, 9+ as well as Java SE 6. No modern version of
  OS X has a Java JDK inside there anyway.


Then to have Java 8 run from the Terminal when using java -version you need to install the JDK not JRE.

Note: I've tested the instructions here under OS X 10,10.3 and it works however maybe you had installed Java 6 for use by some application that needed it, as an example I installed Apples Java 6 to run muCommander however it will run under Java 8 too.