Linux/Alternatives: Difference between revisions

From Omnia
Jump to navigation Jump to search
(Created page with " sudo update-alternatives --config java <pre> There are 3 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode 1 /usr/bin/gij-4.4 1044 manual mode 2 /usr/lib/jvm/java-6-openjdk/jre/bin/java 106...")
 
No edit summary
 
Line 1: Line 1:
== Configure ==
  sudo update-alternatives --config java
  sudo update-alternatives --config java


Line 15: Line 17:


reference: https://stackoverflow.com/questions/12787757/how-to-use-the-command-update-alternatives-config-java
reference: https://stackoverflow.com/questions/12787757/how-to-use-the-command-update-alternatives-config-java
== Install ==
--install <link> <name> <path> <priority>
sudo update-alternatives --install /tmp/randomStuff java /usr/local/java/jre1.7.0_25/bin/java 0
reference: https://unix.stackexchange.com/questions/81992/better-way-to-add-alternative-using-update-alternatives
== keywords ==

Latest revision as of 22:40, 21 October 2025

Configure

sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/bin/gij-4.4                           1044      manual mode
  2            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  3            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

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

reference: https://stackoverflow.com/questions/12787757/how-to-use-the-command-update-alternatives-config-java

Install

--install <link> <name> <path> <priority>
sudo update-alternatives --install /tmp/randomStuff java /usr/local/java/jre1.7.0_25/bin/java 0

reference: https://unix.stackexchange.com/questions/81992/better-way-to-add-alternative-using-update-alternatives

keywords