Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X 10.6.7 Java Path Current JDK confusing

Tags:

java

macos

I have trouble understanding (actual paths vs links) for multiple java versions on my Mac OSX. Normally in windows if I have multiple versions installed in my machine, I can just take the path of which ever version I want and use it. But in MAC OS X I undertand that there is something called links that is being pointed to CurrentJDK, and if I want to use a different version I will need to change the link to CurrentJdk right? But what is confusing for me is that as you can see below all my versions are pointing to the same CurrentJDK which means all versions point to current version? I was expecting only one of them would be pointing to CurrentJDK and I could just change it to which ever one I need which is not the case here. All I need to know is how to find the bin(Commands) folder path for each version, so that I can just use it to point to CurrentJDK? Also tell me how to change the link to CurrentJDK.

$ java -version  java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)  $ pwd  /System/Library/Frameworks/JavaVM.framework/Versions   $ ls -l  lrwxr-xr-x   1 root  wheel    5 Mar 20 11:12 1.3 -> 1.3.1 drwxr-xr-x   3 root  wheel  102 Dec  2  2009 1.3.1 lrwxr-xr-x   1 root  wheel   10 Mar 20 11:12 1.4 -> CurrentJDK lrwxr-xr-x   1 root  wheel   10 Mar 20 11:12 1.4.2 -> CurrentJDK lrwxr-xr-x   1 root  wheel   10 Mar 20 11:12 1.5 -> CurrentJDK lrwxr-xr-x   1 root  wheel   10 Mar 20 11:12 1.5.0 -> CurrentJDK lrwxr-xr-x   1 root  wheel   10 Mar 20 11:12 1.6 -> CurrentJDK lrwxr-xr-x   1 root  wheel   10 Mar 20 11:12 1.6.0 -> CurrentJDK drwxr-xr-x  10 root  wheel  340 Mar 20 11:13 A lrwxr-xr-x   1 root  wheel    1 Mar 20 11:12 Current -> A lrwxr-xr-x   1 root  wheel   59 Mar 20 11:12 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents 
like image 272
reddyvaribabu Avatar asked May 26 '11 15:05

reddyvaribabu


People also ask

What is the path of JDK on Mac?

In macOS, the JDK installation path is /Library/Java/JavaVirtualMachines/jdk-10. jdk/Contents/Home . The root directory of the JDK software installation. This directory also contains copyright, README, and src.


1 Answers

For different types of JDKs or installations, you will have different paths.

On Mac OS X Mavericks, the path I found as following:

1) Built-in JRE default:

 /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 

2) JDKs downloaded from Apple:

 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/ 

3) JDKs downloaded from Oracle:

/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home 
like image 55
Châu Hồng Lĩnh Avatar answered Sep 17 '22 14:09

Châu Hồng Lĩnh