Symbolic link messed up on OSX while trying to change the Java version
Asked Answered
I

1

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.

Impound answered 5/4, 2013 at 23:55 Comment(0)
D
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
Darkle answered 5/4, 2013 at 23:59 Comment(3)
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 ?Impound
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 ! cheersImpound
You might find #15121245 useful in understanding how Java VMs are selected on OS X.Quinn

© 2022 - 2024 — McMap. All rights reserved.