zoukankan      html  css  js  c++  java
  • alternatives命令使用方法

    alternatives命令使用方法


    alternatives是Linux下的一个功能强大的命令。仅仅能在root权限下运行。如系统中有几个命令功能十分相似,却又不能任意删除,那么能够用 alternatives 来指定一个全局的设置。

    alternatives经常使用于同一个系统中安装同一软件的多个版本号。比方为了开发须要,我须要安装JDK1.4.2,同一时候还须要JDK1.6.10,我怎么样才干忽略安装路径,依照我自己的意思,使用我想要的java版本号呢?

    以下为您一一道来。

    alternatives的命令行运行例如以下:
    [root@localhost tools]# alternatives 
    alternatives version 1.3.36 - Copyright (C) 2001 Red Hat, Inc.
    This may be freely redistributed under the terms of the GNU Public License.

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

    common options: --verbose --test --help --usage --version
      --altdir <directory> --admindir <directory>

    说明:
    alternatives --install <link> <name> <path> <priority>
    当中,
    install表示安装
    link是符号链接
    name则是标识符
    path是运行文件的路径
    priority则表示优先级

    以java的安装为例,我的Fedora 8下自带了两种java版本号,分别例如以下:

      Selection Command
    -----------------------------------------------
    * 1 /usr/lib/jvm/jre-1.7.0-icedtea/bin/java
      2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java


    我在文件夹/tools/jdk安装了java version "1.4.2_19"
    [root@localhost test]# alternatives --install /usr/bin/java java /tools/jdk/bin/java 3
    [root@localhost test]# alternatives --config java

    There are 3 programs which provide 'java'.

      Selection Command
    -----------------------------------------------
    *+ 1 /usr/lib/jvm/jre-1.7.0-icedtea/bin/java
      2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
      3 /tools/jdk/bin/java

    Enter to keep the current selection[+], or type selection number: 3


    我还在文件夹/tools/jdk6下安装了java version "1.6.0_12"
    [root@localhost test]# alternatives --install /usr/bin/java java /tools/jdk6/bin/java 4
    [root@localhost test]# alternatives --config java

    There are 4 programs which provide 'java'.

      Selection Command
    -----------------------------------------------
    * 1 /usr/lib/jvm/jre-1.7.0-icedtea/bin/java
      2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
     + 3 /tools/jdk/bin/java
      4 /tools/jdk6/bin/java

    Enter to keep the current selection[+], or type selection number: 4

    用alternatives --config java就能够选择你想要的Java版本号。

  • 相关阅读:
    asp.net string有多行文字
    asp.net设置gridview页码显示遇到的问题
    asp.net button浏览器端事件和服务器端事件
    GridView 控制默认分页页码间距 及字体大小
    复合主键与联合主键(转载)
    vsCode 列选择、列选中、选中列、选中多列(转载)
    可能有用的技术社区(转载)
    SQL 用于各种数据库的数据类型(转载) sqlserver 数据类型 取值范围 长度
    TypeError: value.getTime is not a function (elementUI报错转载 )
    工作1年3个月总结(201707-201810 )
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/4020135.html
Copyright © 2011-2022 走看看