Two equal items in alternatives list

Posted by Red Planet on Ask Ubuntu See other posts from Ask Ubuntu or by Red Planet
Published on 2012-10-07T09:23:27Z Indexed on 2012/10/07 9:51 UTC
Read the original article Hit count: 339

Filed under:
|

I want to have two JDKs. The first one was installed a long time ago to /usr/lib/jvm/java-7-oracle/. I installed the second version and executed following commands to add it to alternatives:

red-planet@laptop:~$ sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java_1.6.0_35/bin/java" 2
update-alternatives: using /opt/java_1.6.0_35/bin/java to provide /usr/bin/java (java) in auto mode.
red-planet@laptop:~$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/java_1.6.0_35/bin/javac" 2
update-alternatives: using /opt/java_1.6.0_35/bin/javac to provide /usr/bin/javac (javac) in auto mode.
red-planet@laptop:~$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/java_1.6.0_35/bin/javaws" 2
update-alternatives: using /opt/java_1.6.0_35/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode.

And configured:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                 Priority   Status
------------------------------------------------------------
* 0            /opt/java_1.6.0_35/bin/java           2         auto mode
  1            /opt/java_1.6.0_35/bin/java           2         manual mode
  2            /usr/lib/jvm/java-7-oracle/bin/java   1         manual mode

Press enter to keep the current choice[*], or type selection number: 

Why do I have two equal items in the list?

© Ask Ubuntu or respective owner

Related posts about jdk

Related posts about update-alternatives