When trying to use my online bank, I was directed to the Java update site (again). I downloaded and installed Java 7 update 17, and the installer reported that everything was a-ok. Clearly, that was something of lie.
Now, when I try to check my Java version on http://java.com/en/download/testjava.jsp, it says that "An old version of Java has been detected on your system". I have tried installing the update again, but the results remain the same. I have also tried rebooting.
On the command line, java -version reports
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)
I remember that there used to be some kind of settings where I could choose between installed Java versions, but now I cannot find it. Under "System preferences" there is no mention of Java, and when I search for Java in Spotlight, the only application that comes up is Java VisualVM, whatever that is.
Any ideas as to what might be wrong?
I am running OS 10.8.3 on an Intel Core i3 iMac with 4 GB RAM.
Best Answer
The problem is that you have two Java Runtime Environments (JREs) installed on your system, Apple's 1.6.x and Oracle's 1.7.x. As evidenced by running
java -version
JRE 1.6 is the default JRE on your system. You likely want to change the default JRE to Oracle's 1.7 JRE.You are correct in that there used to be a System Preference for setting the default JRE. Apple removed that as part of the Java Mac OS X 2012-006 update. The new way for selecting the default JRE is to use the
/usr/libexec/java_home
command. Read the java_home man page as well as the Determining the Default Version of the JDK section of this Oracle page for more info on how to specify the default JRE.