Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explain the JVM Directory Layout on Mac OSX Leopard

Tags:

java

macos

jvm

Here is the directory layout that was installed with Leopard. What is the "A" directory and why the "Current" directory in addition to the "CurrentJDK"?

It seems like you can easily switch the current JDK by move the CurrentJDK link, but then the contents under Current and A will be out of sync.

lrwxr-xr-x  1 root  wheel    5 Jun 14 15:49 1.3 -> 1.3.1
drwxr-xr-x  3 root  wheel  102 Jan 14  2008 1.3.1
lrwxr-xr-x  1 root  wheel    5 Feb 21  2008 1.4 -> 1.4.2
lrwxr-xr-x  1 root  wheel    3 Jun 14 15:49 1.4.1 -> 1.4
drwxr-xr-x  8 root  wheel  272 Feb 21  2008 1.4.2
lrwxr-xr-x  1 root  wheel    5 Feb 21  2008 1.5 -> 1.5.0
drwxr-xr-x  8 root  wheel  272 Feb 21  2008 1.5.0
lrwxr-xr-x  1 root  wheel    5 Jun 14 15:49 1.6 -> 1.6.0
drwxr-xr-x  8 root  wheel  272 Jun 14 15:49 1.6.0
drwxr-xr-x  8 root  wheel  272 Jun 14 15:49 A
lrwxr-xr-x  1 root  wheel    1 Jun 14 15:49 Current -> A
lrwxr-xr-x  1 root  wheel    3 Jun 14 15:49 CurrentJDK -> 1.5
steve-mbp /System/Library/Frameworks/JavaVM.framework/Versions $ 

and the contents of A

-rw-r--r--   1 root  wheel    1925 Feb 29  2008 CodeResources
drwxr-xr-x  34 root  wheel    1156 Jun 14 15:49 Commands
drwxr-xr-x   3 root  wheel     102 Mar  6  2008 Frameworks
drwxr-xr-x  16 root  wheel     544 Jun 14 15:49 Headers
-rwxr-xr-x   1 root  wheel  236080 Feb 29  2008 JavaVM
drwxr-xr-x  29 root  wheel     986 Jun 14 15:49 Resources
steve-mbp /System/Library/Frameworks/JavaVM.framework/Versions/A $ 
like image 794
s_t_e_v_e Avatar asked Sep 30 '08 01:09

s_t_e_v_e


3 Answers

The (A, Current symbolic-linked to A) is part of the structure of a Mac OS X framework, which JavaVM.framework is. This framework may have C or Objective-C code in it, in addition to the actual JVM installations. Thus it could potentially be linked against from some C or Objective-C code in addition to containing the JVM alongside that.

Note that you should not change the CurrentJDK link to point at anything but what it is set to by Mac OS X. Unlike on other platforms, the Java virtual machine is an operating system service on Mac OS X, and changing it in this way would put you in an unsupported (and potentially untested, unstable, etc.) configuration.

like image 196
Chris Hanson Avatar answered Nov 10 '22 21:11

Chris Hanson


You should use the Java Preferences command to change the jvm version.

If you have spotlight on your Harddisk, you can just spotlight "Java Preferences"

like image 21
Milhous Avatar answered Nov 10 '22 20:11

Milhous


If you want to revert to an older JVM (here, 1.5), you can put the following in your ~/.profile (or paste it into a specific Terminal window):

export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/"
export PATH=$JAVA_HOME/bin/:$PATH
like image 2
Joe Liversedge Avatar answered Nov 10 '22 22:11

Joe Liversedge