我想创建空目录/Library/Java/JavaVirtualMachines/jdk1.8.0_5.jdk/Contents/Home/
,它指向真实目录/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/
,因为一些代码依赖于这个特定版本的JDK(1.8.0_5,但我只有1.8.0_74)但是ln命令失败并出现以下错误,任何想法有什么不对?谢谢。
顺便说一句,我使用的是Mac OSX。
ls -l /Library/Java/JavaVirtualMachines/
total 0
drwxr-xr-x 3 root root 102 Jan 20 16:32 Contents
drwxr-xr-x 3 root root 102 Jan 25 16:16 jdk1.8.0_05.jdk
drwxr-xr-x 3 root root 102 Jan 25 16:15 jdk1.8.0_25.jdk
drwxr-xr-x 3 root root 102 Jan 25 16:15 jdk1.8.0_40.jdk
drwxr-xr-x 3 root root 102 Jan 20 16:32 jdk1.8.0_72.jdk
drwxr-xr-x 3 root root 102 Feb 5 15:25 jdk1.8.0_74.jdk
ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_5.jdk/Contents/Home/ /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/
ln: /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home//Home: File exists
来自Schlachter的更新,尝试过的解决方案,但遇到了新问题,
ls /Library/Java/JavaVirtualMachines
Contents jdk1.7.0_51.jdk jdk1.8.0_25.jdk jdk1.8.0_72.jdk jdk1.8.0_77.jdk
jdk1.7.0_21.jdk jdk1.8.0_05.jdk jdk1.8.0_40.jdk jdk1.8.0_74.jdk
ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk1.8.0_5.jdk/Contents/
ln: /Library/Java/JavaVirtualMachines/jdk1.8.0_5.jdk/Contents/: No such file or directory
jdk1.8.0_74.jdk/Contents/Home
?jdk1.8.0_74.jdk/Contents/Home
是真实内容的目录,我想创建一个/Library/Java/JavaVirtualMachines/jdk1.8.0_5.jdk/Contents/Home
实际链接到 的目录名jdk1.8.0_74.jdk/Contents/Home
,它具有真实内容。