Pages

Wednesday, December 2, 2015

"No such file or directory” when adding application with alternatives in Linux


Issue 

# alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_07/jre/bin/javaws  20000
failed to read link /usr/bin/javaws: No such file or directory

or 

sudo update-alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000
failed to read link /usr/bin/jar: No such file or directory

Fix 

sudo rm /usr/bin/jar
sudo rm /var/lib/alternatives/jar
sudo alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000

rm /var/lib/alternatives/javaws
rm /var/lib/alternatives/javawsrm: remove regular file `/var/lib/alternatives/javaws'? y alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_07/jre/bin/javaws  20000

No comments:

Post a Comment