linux-alternatives

If there are several commands in the system that are very similar in function but cannot be deleted at will, you can use alternatives to specify a global setting.

# alternatives
usage: alternatives --install <link> <name> <path> <priority>
                    [--initscript <service>]
                    [--family <family>]
                    [--slave <link> <name> <path>]*
       alternatives --remove <name> <path>
       alternatives --auto <name>
       alternatives --config <name>
       alternatives --display <name>
       alternatives --set <name> <path>
       alternatives --list

common options: --verbose --test --help --usage --version --keep-missing
                --altdir <directory> --admindir <directory>
我在目录/tools/jdk安装了java version "1.7.2_19"
# alternatives --install /usr/bin/java java /tools/jdk/bin/java 3
# alternatives --config java (设置需要版本)

Published 52 original articles · won praise 2 · Views 6374

Guess you like

Origin blog.csdn.net/wenwang3000/article/details/99644951