1

I done a bad thing please help.

I was in:

/System/Library/Frameworks/JavaVM.framework/Versions

I was told to run the following command:

sudo ln -fhsv 1.6 CurrentJDK

Which has pretty messed everything up:

lrwxr-xr-x   1 root  wheel   10  5 Apr 20:57 1.4 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10  5 Apr 20:57 1.4.2 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10  5 Apr 20:57 1.5 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10  5 Apr 20:57 1.5.0 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10  5 Apr 20:57 1.6 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10  5 Apr 20:57 1.6.0 -> CurrentJDK
drwxr-xr-x   8 root  wheel  272  5 Apr 20:57 A
lrwxr-xr-x   1 root  wheel    1  5 Apr 20:57 Current -> A
lrwxr-xr-x   1 root  wheel    3  6 Apr 00:22 CurrentJDK -> 1.6

How can I revert this so that 1.6 is not a symbolic link? This was a directory before.

James M
  • 18,506
  • 3
  • 48
  • 56
drlobo
  • 2,139
  • 5
  • 32
  • 42

1 Answers1

2

My directory looks like this:

$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions
total 64
lrwxr-xr-x  1 root  wheel   10 Mar 11 20:37 1.4 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Mar 11 20:37 1.4.2 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Mar 11 20:37 1.5 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Mar 11 20:37 1.5.0 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Mar 11 20:37 1.6 -> CurrentJDK
lrwxr-xr-x  1 root  wheel   10 Mar 11 20:37 1.6.0 -> CurrentJDK
drwxr-xr-x  8 root  wheel  272 Mar 11 20:37 A
lrwxr-xr-x  1 root  wheel    1 Mar 11 20:37 Current -> A
lrwxr-xr-x  1 root  wheel   59 Mar 11 20:37 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

so do this:

sudo -s
cd /System/Library/Frameworks/JavaVM.framework/Versions
ln -sf /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents 1.6
rongenre
  • 1,334
  • 11
  • 21
  • Thanks ! so now I have CurrentJDK pointing to 1.6 and 1.6 is linked to my 1.6 java virtual machine. Yet ... when I type Java -version it still points to java 7 ? Where does MAC get this value from ? – drlobo Apr 06 '13 at 00:07
  • Well I got i just type : export JAVA_HOME=/Library/Java/Home. It makes no logical sense to me but thats how it is. Anyway everything finally working ! cheers – drlobo Apr 06 '13 at 00:11
  • 1
    You might find http://stackoverflow.com/questions/15120745/need-help-understanding-oracles-java-on-mac/15133344#15133344 useful in understanding how Java VMs are selected on OS X. – bdash Apr 06 '13 at 00:54