views:

56

answers:

1

Anyone run into this?

I realize that 1.6 is the default on OS X, but I'm trying to compile/run a program on the command-line using 1.5. However, no matter what I try, it reports 1.6.

/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)
rtp-wwilliam-8712:bin wwilliam$ 

Note the full path to the java binary. No matter what earlier version of Java I try, I always get 1.6 reported as the version.

The java binary does exist at that path. That directory is also the first directory in my path.

Using OS X 10.6.3 with the latest java updates installed.

Thoughts?

+8  A: 

Because on 10.6, 1.5 (in the JavaVM framework) is symlinked to 1.6. OS X 10.6 only ships with 1.3 and 1.6; 1.4 and 1.5 are symlinks to 1.6:

$ ll /System/Library/Frameworks/JavaVM.framework/Versions/
total 64
lrwxr-xr-x  1 root  wheel     5B May 19 12:17 1.3@ -> 1.3.1
drwxr-xr-x  3 root  wheel   102B Dec  2 20:55 1.3.1/
lrwxr-xr-x  1 root  wheel    10B May 19 12:17 1.4@ -> CurrentJDK
lrwxr-xr-x  1 root  wheel    10B May 19 12:17 1.4.2@ -> CurrentJDK
lrwxr-xr-x  1 root  wheel    10B May 19 12:17 1.5@ -> CurrentJDK
lrwxr-xr-x  1 root  wheel    10B May 19 12:17 1.5.0@ -> CurrentJDK
lrwxr-xr-x  1 root  wheel     5B May 19 12:17 1.6@ -> 1.6.0
drwxr-xr-x  8 root  wheel   272B May 19 17:56 1.6.0/
drwxr-xr-x  9 root  wheel   306B May 19 17:56 A/
lrwxr-xr-x  1 root  wheel     1B May 19 12:17 Current@ -> A
lrwxr-xr-x  1 root  wheel     3B May 19 12:17 CurrentJDK@ -> 1.6
mipadi
Doh! I checked for symbolic links on the binary but didn't go that far back in the tree. I had heard 1.6 removed previous versions on some systems, but I thought since I still saw the directories there I thought that it hadn't done so on mine. Thanks.
Wade Williams