I did not install the IcedTea plugin and the openJDK.
Other than that the compiler (javac) also needs to be updated. To do that run the following commands:
update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/64/jdk1.6.0_31/bin/javac" 1
update-alternatives --set javac /opt/java/64/jdk1.6.0_32/bin/javac
For the java browser plug-in it is also possible to use update-alternatives to change the browser plug-in:
sudo /usr/sbin/update-alternatives --install /usr/lib64/browser-plugins/javaplugin.so javaplugin /opt/java/jdk1.7.0_25/jre/lib/amd64/libnpjp2.so 3 --slave /usr/bin/javaws javaws /opt/java/jdk1.7.0_25/jre/bin/javaws --slave /usr/share/man/man1/javaws.1 javaws.1 /opt/java/jdk1.7.0_25/man/man1/javaws.1
update-alternatives --config javaplugin