当我在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>
我得到了输出,因为我没有安装java。我想知道 openjdk-7-jre-headless 和 openjdk-7-jre
之间的区别答案 0 :(得分:15)
Debian for Java中使用了几个虚拟包。这些包括运行时兼容性,有两种风格;无头(省略图形界面)和正常。
或者更确切地说,请考虑this description from Oracle:
无头模式是缺少显示设备,键盘或鼠标的系统配置。听起来很意外,但实际上你可以在这种模式下执行不同的操作,即使是图形数据也是如此。
答案 1 :(得分:7)
无头是与后者相同的版本,没有得到支持 键盘,鼠标和显示系统。因此它具有较少的依赖性 它使它更适合服务器应用。
答案 2 :(得分:0)
To add to previous answers the normal java depends on the headless and install some extra packages.
I tried to compare dependencies of:
The comparison done with yum install
on Centos 7.6
The normal Java (in contrast to headless) installed following extras:
=============================|========|=========================|============|=======|=================| 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-headless is a dependency of java-1.8.0-openjdk.
Also note that the concrete dependencies may differ on your system.