我做了一件坏事,请帮忙。
我在:
/System/Library/Frameworks/JavaVM.framework/Versions
我被告知要运行以下命令:
sudo ln -fhsv 1.6 CurrentJDK
这让一切搞得一团糟:
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
如何将其恢复为1.6
不是符号链接?这是之前的目录。
答案 0 :(得分:2)
我的目录如下所示:
$ 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
这样做:
sudo -s
cd /System/Library/Frameworks/JavaVM.framework/Versions
ln -sf /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents 1.6