java openjdk-7-jre-headless 和 openjdk-7-jre(jdk) 有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32862344/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 20:53:15  来源:igfitidea点击:

What is the difference between openjdk-7-jre-headless and openjdk-7-jre(jdk)?

javaubuntuheadless

提问by 3ppps

When I type for java -versionin command prompt in ubuntu I get following output

当我在 ubuntu 的命令提示符中输入java -version 时,我得到以下输出

The program 'java' can be found in the following packages:
 * default-jre
 * gcj-4.8-jre-headless
 * openjdk-7-jre-headless
 * gcj-4.6-jre-headless
 * openjdk-6-jre-headless
Try: apt-get install <selected package>

I get above output as I do not have java install. I want to know difference between openjdk-7-jre-headlessand openjdk-7-jre

我得到了上面的输出,因为我没有安装 java。我想知道openjdk-7-jre-headlessopenjdk-7-jre之间的区别

回答by Mureinik

To quote debian's wiki:

引用debian 的 wiki

There are several virtual packages used in Debian for Java. These cover runtime compatibility and come in two flavours; headless (omits graphical interfaces) and normal.

Debian for Java 中使用了几个虚拟包。这些涵盖了运行时兼容性并有两种风格;无头(省略图形界面)和正常。

Or to be more exact, consider this description from Oracle:

或者更准确地说,请考虑Oracle 的以下描述

Headlessmode is a system configuration in which the display device, keyboard, or mouse is lacking. Sounds unexpected, but actually you can perform different operations in this mode, even with graphic data.

Headless模式是一种系统配置,其中缺少显示设备、键盘或鼠标。听起来很意外,但实际上您可以在此模式下执行不同的操作,即使是图形数据。

回答by abarisone

As reported in this blog

正如这篇博客中所报道的

Headless is the same version than the latter without the support of keyboard, mouse and display systems. Hence it has less dependencies and it makes it more suitable for server application.

Headless 是与后者相同的版本,不支持键盘、鼠标和显示系统。因此它具有较少的依赖性,并且使其更适合于服务器应用程序。

回答by sumid

To add to previous answers the normal java depends on the headless and install some extra packages.

要添加到以前的答案,正常的 java 依赖于无头并安装一些额外的包。

I tried to compare dependencies of:

我试图比较依赖项:

  • java-1.8.0-openjdk-headless-1.8.0.191.b12-0.el7_5.x86_64
  • java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64
  • java-1.8.0-openjdk-headless-1.8.0.191.b12-0.el7_5.x86_64
  • java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64

The comparison done with yum installon Centos 7.6

yum install在 Centos 7.6 上完成的比较

The normal Java (in contrast to headless) installed following extras:

正常的 Java(与无头相比)安装了以下附加功能:

=============================|========|=========================|============|=======|=================|
 Package                     | Arch   | Version                 | Repository |  Size | Vulnerabilities |
=============================|========|=========================|============|=======|=================|
 alsa-lib                    | x86_64 | 1.1.6-2.el7             | centos_7.6 | 424 k | 1 | 2005        |
 dejavu-fonts-common         | noarch | 2.33-6.el7              | centos_7.6 |  64 k | - |             |
 dejavu-sans-fonts           | noarch | 2.33-6.el7              | centos_7.6 | 1.4 M | - |             |
 fontconfig                  | x86_64 | 2.13.0-4.3.el7          | centos_7.6 | 254 k | 1 | 2016        |
 fontpackages-filesystem     | noarch | 1.44-8.el7              | centos_7.6 | 9.9 k | - |             |
 giflib                      | x86_64 | 4.1.6-9.el7             | centos_7.6 |  40 k | 5 | 2018        |
 java-1.8.0-openjdk-headless | x86_64 | 1:1.8.0.191.b12-0.el7_5 | centos_7.6 |  32 M | ? |             |
 libICE                      | x86_64 | 1.0.9-9.el7             | centos_7.6 |  66 k | 1 | 2018        |
 libSM                       | x86_64 | 1.2.2-2.el7             | centos_7.6 |  39 k | - |             |
 libX11                      | x86_64 | 1.6.5-2.el7             | centos_7.6 | 606 k | 3 | 2013        |
 libX11-common               | noarch | 1.6.5-2.el7             | centos_7.6 | 164 k |   |             |
 libXau                      | x86_64 | 1.0.8-2.1.el7           | centos_7.6 |  29 k |   |             |
 libXcomposite               | x86_64 | 0.4.4-4.1.el7           | centos_7.6 |  22 k |   |             |
 libXext                     | x86_64 | 1.3.3-3.el7             | centos_7.6 |  39 k |   |             |
 libXi                       | x86_64 | 1.7.9-1.el7             | centos_7.6 |  40 k |   |             |
 libXrender                  | x86_64 | 0.9.10-1.el7            | centos_7.6 |  26 k |   |             |
 libXtst                     | x86_64 | 1.2.3-1.el7             | centos_7.6 |  20 k |   |             |
 libfontenc                  | x86_64 | 1.1.3-3.el7             | centos_7.6 |  31 k |   |             |
 libxcb                      | x86_64 | 1.13-1.el7              | centos_7.6 | 214 k |   |             |
 ttmkfdir                    | x86_64 | 3.0.9-42.el7            | centos_7.6 |  48 k | - |             |
 xorg-x11-font-utils         | x86_64 | 1:7.5-21.el7            | centos_7.6 | 104 k | 1 | 2008        |
 xorg-x11-fonts-Type1        | noarch | 7.5-9.el7               | centos_7.6 | 521 k |   |             |
=============================|========|=========================|============|=======|=================| 

Note that java-1.8.0-openjdk-headlessis a dependency of java-1.8.0-openjdk.
Also note that the concrete dependencies may differ on your system.

请注意,java-1.8.0-openjdk-headlessjava-1.8.0-openjdk的依赖项。
另请注意,具体依赖项可能因您的系统而异。