Java linux中的updatealternations命令是什么?它的用途是什么?

Java linux中的updatealternations命令是什么?它的用途是什么?,java,linux,Java,Linux,在Linux中安装java时,会用到updatealternations命令,因为我是Linux环境的新手,我想知道这个命令的作用和用途 >>sudo update-alternatives --install /usr/bin/java java /usr/lib/java/JDk.../bin/java 基本上,它告诉您的机器使用javejdk的这个替代品,而不是默认的javejdk,在Linux系统中,默认的javejdk是OpenJDK 从手册页中摘录一段简短的内容比我能写

在Linux中安装java时,会用到updatealternations命令,因为我是Linux环境的新手,我想知道这个命令的作用和用途

>>sudo update-alternatives --install /usr/bin/java java /usr/lib/java/JDk.../bin/java

基本上,它告诉您的机器使用javejdk的这个替代品,而不是默认的javejdk,在Linux系统中,默认的javejdk是OpenJDK

从手册页中摘录一段简短的内容比我能写出的任何答案都要好:

更新备选方案创建、删除、维护和显示有关符号链接的信息 Debian替代系统

通过--install,您指定了一个链接,“/usr/bin/java”一个名称“java”和一个路径“/usr/lib/java/JDK…”,并向系统添加了一组备选方案。link是主链接的通用名称,name是其符号链接在alternatives目录中的名称,path是为主链接引入的备选方案

我希望说得够清楚,这里有一个问题


对于完整的使用列表,我建议查看相同的手册页面,在操作系统外壳上键入manupdatealternations

基本上,它告诉您的机器使用Jave JDK的这个替代品,而不是默认的,在Linux系统中是OpenJDK

从手册页中摘录一段简短的内容比我能写出的任何答案都要好:

更新备选方案创建、删除、维护和显示有关符号链接的信息 Debian替代系统

通过--install,您指定了一个链接,“/usr/bin/java”一个名称“java”和一个路径“/usr/lib/java/JDK…”,并向系统添加了一组备选方案。link是主链接的通用名称,name是其符号链接在alternatives目录中的名称,path是为主链接引入的备选方案

我希望说得够清楚,这里有一个问题

对于完整的使用列表,我建议查看相同的手册页面,在操作系统外壳上键入manupdatealternations

   It is possible for several programs fulfilling the same or similar functions to be installed on a single  sys‐
   tem  at  the  same  time.   For example, many systems have several text editors installed at once.  This gives
   choice to the users of a system, allowing each to use a different editor, if desired, but makes  it  difficult
   for a program to make a good choice for an editor to invoke if the user has not specified a particular prefer‐
   ence.

   Debian's alternatives system aims to solve this problem.  A generic name in the filesystem is  shared  by  all
   files  providing interchangeable functionality.  The alternatives system and the system administrator together
   determine which actual file is referenced by this generic name.  For example, if the text  editors  ed(1)  and
   nvi(1)  are  both installed on the system, the alternatives system will cause the generic name /usr/bin/editor
   to refer to /usr/bin/nvi by default. The system administrator can override this  and  cause  it  to  refer  to
   /usr/bin/ed  instead, and the alternatives system will not alter this setting until explicitly requested to do
   so.