我正在寻找如何在 Debian 上正确安装 java。来到 Debian wiki(这是我在 Debian 上真正欣赏的一件事,这个 wiki 很棒),这是我在那里得到的提示:
只需在您的系统上运行
aptitude search "?provides(java-runtime)"
即可列出可用的软件包)。
所以我认为这?provides
是描述中的一些查询,但是看哪:
i A default-jre - Standard Java or Java compatible Runtime
p default-jre:i386 - Standard Java or Java compatible Runtime
i A default-jre-headless - Standard Java or Java compatible Runtime (headless)
p default-jre-headless:i386 - Standard Java or Java compatible Runtime (headless)
p gcj-4.8-jre - Java runtime environment using GIJ/Classpath
p gcj-4.8-jre:i386 - Java runtime environment using GIJ/Classpath
p gcj-4.8-jre-headless - Java runtime environment using GIJ/Classpath (headless version)
p gcj-4.8-jre-headless:i386 - Java runtime environment using GIJ/Classpath (headless version)
p gcj-4.9-jre - Java runtime environment using GIJ/Classpath
p gcj-4.9-jre:i386 - Java runtime environment using GIJ/Classpath
p gcj-4.9-jre-headless - Java runtime environment using GIJ/Classpath (headless version)
p gcj-4.9-jre-headless:i386 - Java runtime environment using GIJ/Classpath (headless version)
p gcj-jre - Java runtime environment using GIJ/Classpath
p gcj-jre:i386 - Java runtime environment using GIJ/Classpath
p gcj-jre-headless - Java runtime environment using GIJ/Classpath (headless version)
p gcj-jre-headless:i386 - Java runtime environment using GIJ/Classpath (headless version)
i A openjdk-7-jre - OpenJDK Java runtime, using Hotspot JIT
p openjdk-7-jre:i386 - OpenJDK Java runtime, using Hotspot JIT
i A openjdk-7-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
p openjdk-7-jre-headless:i386 - OpenJDK Java runtime, using Hotspot JIT (headless)
该字符串java-runtime
永远不会出现在输出中,这表明存在正在查询的隐藏属性。这些是哪些?
答案1
每个包都有不同的字段。您会看到列出的包名称和简短描述,但查询Provides
- 字段。
您可以使用以下命令列出包的所有可用版本的所有字段
$ apt-cache show openjdk-7-jre
并得到(缩短,取决于您的系统:)
[...]
Package: openjdk-7-jre
Source: openjdk-7
Version: 7u3-2.1.7-1
[...]
Architecture: amd64
Provides: java-runtime, java2-runtime, java5-runtime, java6-runtime, java7-runtime
Depends: openjdk-7-jre-headless (= 7u3-2.1.7-1), libasound2 (>= 1.0.16), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.11), libcairo2 (>= 1.2.4), libcups2 (>= 1.4.0), libfontconfig1 (>= 2.9.0), libfreetype6 (>= 2.2.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libgif4 (>= 4.1.4), libglib2.0-0 (>= 2.16.0), libgtk2.0-0 (>= 2.8.0), libjpeg8 (>= 8c), libpango1.0-0 (>= 1.14.0), libpng12-0 (>= 1.2.13-4), libpulse0 (>= 0.99.1), libx11-6, libxext6, libxi6, libxrender1, libxtst6, zlib1g (>= 1:1.1.4), libxrandr2, libxinerama1, libgl1-mesa-glx | libgl1, libatk-wrapper-java-jni (>= 0.30.4-0ubuntu2)
Recommends: libgnome2-0, libgnomevfs2-0, libgconf2-4, ttf-dejavu-extra
Suggests: icedtea-7-plugin
Conflicts: icedtea-gcjwebplugin (<< 1.0-1ubuntu4)
Description-en: OpenJDK Java runtime, using Hotspot JIT
Full Java runtime environment - needed for executing Java GUI and Webstart
programs. Using Hotspot JIT.
The packages are built using the IcedTea build support and patches
from the IcedTea project.
[...]
关于列出的文件:
:i386
表示该包用于i386
架构(不是amd64
您可能正在使用的架构)headless
意味着没有图形显示的系统(较少的依赖性)gcj
gcc
是项目中的java运行时openjdk
是更多官方的您可能想要使用的 java 的免费实现