Java openjdk-6-jre、openjdk-6-jre-headless、openjdk-6-jre-lib 的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24280872/
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
Difference between openjdk-6-jre, openjdk-6-jre-headless, openjdk-6-jre-lib
提问by Jorge
I am having trouble understanding some of the basics of Java JRE.
我无法理解 Java JRE 的一些基础知识。
I need to run Java code in an embedded system and for this I need a minimal Java Runtime Environment installed in a Linux kernel, that is to say, the minimum package necessary for executing Java binaries. I think it is not possible to do this only with a JVM (the JRE package is necessary, am I wrong here?)
我需要在嵌入式系统中运行 Java 代码,为此我需要在 Linux 内核中安装一个最小的 Java 运行时环境,也就是说,执行 Java 二进制文件所需的最小包。我认为仅使用 JVM 不可能做到这一点(JRE 包是必需的,我在这里错了吗?)
The thing is, when looking at the Debian repositories I don't quite understand the differences between the packages openjdk-6-jre
, openjdk-6-jre-headless
and openjdk-6-jre-lib
. Will Java programs run only with the former? or, are the three of them needed?
问题是,在查看 Debian 存储库时,我不太明白包openjdk-6-jre
,openjdk-6-jre-headless
和openjdk-6-jre-lib
. Java 程序只能与前者一起运行吗?或者,他们三个都需要吗?
This is an issue as there is a big difference in size (MB) between them.
这是一个问题,因为它们之间的大小 (MB) 存在很大差异。
采纳答案by Woodham
You are correct in that you will need a JRE package to run any Java application.
你是对的,你需要一个 JRE 包来运行任何 Java 应用程序。
Since you say you're running on an embedded platform I assume that the Java application you want to run has no GUI. In that case, you will be fine with openjdk-6-jre-headless
. This is explained on the openjdk-6-jre-headless package page here"Minimal Java runtime - needed for executing non GUI Java programs".
由于您说您在嵌入式平台上运行,因此我假设您要运行的 Java 应用程序没有 GUI。在这种情况下,您可以使用openjdk-6-jre-headless
. 这在此处的openjdk-6-jre-headless 包页面“最小 Java 运行时 - 执行非 GUI Java 程序所需”中进行了解释。
As you can see from the debian package details page, openjdk-6-jre-headless
depends on openjdk-6-jre-lib
(among other packages), so that will get installed either way.
正如您从 debian 软件包详细信息页面看到的,openjdk-6-jre-headless
依赖openjdk-6-jre-lib
(在其他软件包中),因此无论哪种方式都可以安装。
If however the Java application you want to run has a GUI, you will need openjdk-6-jre
instead of openjdk-6-jre-headless
但是,如果您要运行的 Java 应用程序具有 GUI,您将需要openjdk-6-jre
而不是openjdk-6-jre-headless
回答by Daniel
The main reason for having two distinct packages available are the dependencies of the packages. openjdk-6-jre
will also depend on:
有两个不同的包可用的主要原因是包的依赖关系。openjdk-6-jre
还将取决于:
libasound2, libgif4, libjpeg62, libpng12-0, libpulse0 , libx11-6, libxext6, libxi6, libxrender1, libxtst6 and zlib1g
And contrary to the previous comment openjdk-6-jre
depends on openjdk-6-jre-headless
, making the latter really just a subset.
与前面的评论相反,openjdk-6-jre
取决于openjdk-6-jre-headless
,使后者实际上只是一个子集。