I was trying to install jre-7u45-macosx-x64.dmg and I don't know why it doesn't overwrite java 6.
I've read a lot of topics, tried all of them. http://support.apple.com/kb/DL1572?viewlocale=en_US http://www.cc.gatech.edu/~simpkins/teaching/gatech/cs2340/guides/java7-macosx.html
After all of it, I just downloaded jdk-7u51-macosx-x64.dmg and it worked. The version 7 overwrited the 6.
Alessandros-MacBook:~ alessandrogarcez$ java -version java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)