Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I typed:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/ jdk1.8.0/bin/java" 1

It's says alternatives --install needs link name path priority

share|improve this question
    
What are you typing exactly? please be careful with any punctuation (e.g. dashes) and spaces –  steeldriver Jul 5 at 16:42
    
@steeldriver could you explain link name path priority . If there were no link like "/user/bin/java/" then will erroneous result? –  Swapnil Jul 5 at 16:53
    
It should create the link (and the name if there is no current java group in /etc/alternatives). AFAIK the only thing that must pre-exist is the path component i.e. /usr/lib/jvm/jdk1.8.0/bin/java - but note that (as posted in your question) you have a space in yours - hence my 1st comment. –  steeldriver Jul 5 at 16:58
    
@steeldriver yeah /usr/lib/jvm/bin/java/ is available . I've try sudo update-alternatives -- install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0.05/bin/java" 1 –  Swapnil Jul 5 at 17:22
    
Are you leaving a space between the -- and the word install? if so, don't - it needs to be --install. Also the quotes should not be necessary, just sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0.05/bin/java 1 –  steeldriver Jul 5 at 17:35

2 Answers 2

up vote 1 down vote accepted

Are you leaving a space between the -- and the word install? if so, don't - it needs to be --install

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0.05/bin/java 1

The quotes should not be necessary since none of the elements have embedded spaces - although they shouldn't do any harm.

share|improve this answer

This is beacause this command maintains symbolic links. I recommend to execute man update-alternatives to get more information about the command.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.