mkdir /path/where/newsymlink ln -s /path/to/point/to /path/where/newsymlink/is mv /path/where/newsymlink/is /path/where/symlink/ rmdir /path/where/newsymlink
However, the Java Preferences utility changes more than just a symbolic link; you should use that to ensure that the Java version is changed.
ln -hfs newlocation existinglink
ln -nfs newlocation existinglink
will change the existing link to point to
-h are identical in operation)
target_diris a symbolic link, do not follow it. This is most useful with the
-foption, to replace a
symlink which may point to a directory.
-fIf the target file already exists, then unlink it so that the link may occur. (The
-foption overrides any previous
-sCreate a symbolic link
unlink /path/to/current/link ln -s /path/to/target /path/to/symbolic/link
The ln command doesn’t let you change links, only create new ones.
Have you compared the permissions on the links and on the targets before and after you change the link? You might just need to follow up with the appropriate chown and chmod commands to get it working.