Why is OS X java always reporting 1.6?

Does anyone come across this?

I understand that 1.6 is used by default for OS X, but I'm trying to compile / run the 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$ 

Pay attention to the full path to the java binary. No matter what early version of Java I try, I always get 1.6 as the version.

A Java binary exists along this path. This directory is also the first directory in my path.

Using OS X 10.6.3 with the latest java updates installed.

Thoughts?

+3
source share
1 answer

10.6, 1.5 ( JavaVM) 1.6. OS X 10.6 1.3 1.6; 1.4 1.5 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
+8

Source: https://habr.com/ru/post/1748208/


All Articles