3

I downloaded the latest version of Java from Oracle site and installed it on my mac.

MacCris:~ cris$ java -version
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

then,

MacCris:/ cris$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions
total 64
lrwxr-xr-x  1 root  wheel   10 Jan  3 20:20 1.4 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Jan  3 20:20 1.4.2 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Jan  3 20:20 1.5 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Jan  3 20:20 1.5.0 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Jan  3 20:20 1.6 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Jan  3 20:20 1.6.0 -> CurrentJDK
drwxr-xr-x  7 root  wheel  238 Jan  3 20:20 A
lrwxr-xr-x  1 root  wheel    1 Jan  3 20:20 Current -> A
lrwxr-xr-x  1 root  wheel   59 Jan  3 20:20 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

going to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents and executing

MacCris:bin cris$ /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

So the currentJDK is 1.6 despite i installed latest java.

4
  • Are you asking why "java --version" gives 1.0.6 even though you have installed 1.7?
    – Phorce
    Commented Jan 30, 2013 at 18:06
  • Current is in 1.6.0.jdk and shows the latest 1.6 and the one you installed is 1.7 what exactly are you asking?
    – mmmmmm
    Commented Jan 30, 2013 at 18:25
  • Sorry thanks ...i was tired when i wrote it...thanks for clear things...i did not paid attention to MacCris:bin cris$ /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -version java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
    – Cris
    Commented Jan 30, 2013 at 19:00
  • actially I was puzzled why CurrentJDK is 1.6 not 1.7
    – Cris
    Commented Jan 30, 2013 at 19:06

1 Answer 1

2

The Oracle Java ie 1.7 does not install itself in the same place as the Apple Java ie <= 1.6.

The java executable is in /Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home/bin/java

This is possibly because only Apple supplied files should be under /System

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .