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
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityAre 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.
The command sintax is
sudo update-alternatives --install <link> <name> <path> <priority>
if there are no space in the parameters, you don't need quotes.
In your case:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0/bin/java 1
Pay attention: did you really have a space in the path before jdk?
Just trying to contribute with this post. I use this command, once that I know my setup correctly.
echo 1 | sudo update-alternatives --config java
This is beacause this command maintains symbolic links. I recommend to execute man update-alternatives
to get more information about the command.
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.--
and the wordinstall
? if so, don't - it needs to be--install
. Also the quotes should not be necessary, justsudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0.05/bin/java 1