java 服务器 JRE 和客户端 JRE 之间的区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33407297/
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 21:37:54  来源:igfitidea点击:

Difference between server JRE and client JRE

javajava-8jdk1.6

提问by Kaustubh_Kharche

I was going through server jre, when i extracted serverjre tar.gz , it gave me jdk folder. why does serverJRE gives JDK like folder. There is JRE folder inside serverJRE also. So which one to use, whole serverJRE or just JRE folder which is inside serverJRE. Also contents of JRE inside serverJRE is same as JRE inside JDK.

我正在浏览服务器 jre,当我提取 serverjre tar.gz 时,它给了我 jdk 文件夹。为什么 serverJRE 给 JDK 类似的文件夹。serverJRE 里面也有 JRE 文件夹。那么使用哪个,整个 serverJRE 或只是 serverJRE 内的 JRE 文件夹。serverJRE 中 JRE 的内容也与 JDK 中的 JRE 相同。

I am not understanding the difference.

我不明白其中的区别。

回答by Kevin Andrid

Server JRE:It is used to deploy long-running java applications on server. It provides the fastest possible operating speed. It has been specifically fine tuned to maximize peak operating speed. It has highly aggressive algorithms to optimize the runtime performance of java application. It also includes variety of monitoring tools.

服务器 JRE:用于在服务器上部署长时间运行的 Java 应用程序。它提供了最快的运行速度。它已经过专门微调,以最大限度地提高峰值运行速度。它具有高度激进的算法来优化 Java 应用程序的运行时性能。它还包括各种监控工具。

Client JRE:It is used to run java applications on the end-users systems. It contains everything to run the java applications. It can start up faster and requires a smaller memory footprint.

客户端 JRE:用于在最终用户系统上运行 Java 应用程序。它包含运行 Java 应用程序的所有内容。它可以更快地启动并且需要更小的内存占用。

回答by Kayaman

From Oracle's page.

来自Oracle 的页面

The Server JRE includes tools for JVM monitoring and tools commonly required for server applications, but does not include browser integration (the Java plug-in).

服务器 JRE 包括用于 JVM 监控的工具和服务器应用程序通常需要的工具,但不包括浏览器集成(Java 插件)。

So the difference is incredibly small. This would also mean that the difference between Server JRE and the JDK seems to be mainly that the JDK has a compiler. I didn't even realize that they have made the JREs into separate products, but over the years I can't remember anyone ever suggesting the Client JRE to anyone.

所以差异非常小。这也意味着 Server JRE 和 JDK 之间的区别似乎主要在于 JDK 具有编译器。我什至没有意识到他们已经将 JRE 制作成单独的产品,但多年来我不记得有人向任何人推荐过客户端 JRE。

Considering that Applets are all but dead, I don't see any good reason to download the Client JRE. Then again I'm not in the business for desktop Java, so who knows.

考虑到 Applet 几乎已死,我认为没有任何理由下载客户端 JRE。再说一次,我不从事桌面 Java 的业务,所以谁知道呢。

回答by user3183018

I don't think people understood where the OP was coming from and I just ran into this. What follows is some detailed context.

我认为人们不明白 OP 的来源,而我刚刚遇到了这个问题。下面是一些详细的上下文。

As of the latest quarterly updates the root level directory inside the server jre gzipped tar ball inside of "p22187044_17095_Linux-x86-64.zip" is "jdk1.7.0_95"

截至最新的季度更新,“p22187044_17095_Linux-x86-64.zip”中的服务器 jre gzip tar ball 内的根级目录为“jdk1.7.0_95”

IMO, this is sloppy on Oracle's part. In the case where you need to work with both and attempt to extract each in the same directory, you will be extracting both into the same directory.

IMO,这对 Oracle 来说是草率的。如果您需要同时使用两者并尝试将每个提取到同一目录中,则将两者提取到同一目录中。

$ unzip p22187044_17095_Linux-x86-64.zip server-jre-7u95-linux-x64.tar.gz
$ tar xzvf server-jre-7u95-linux-x64.tar.gz
# Extracted files with top-level directory: "jdk1.7.0_95"
# This polluted my previously extracted JDK (See differences below).

# Get a clean JDK 7 again:
$ rm -rf jdk1.7.0_95/

$ tar xzvf jdk-7u95-linux-x64.tar.gz

# Try again with the JRE; this time creating a container directory for the tar extraction:
$ mkdir jre1.7.0_95   &&   tar  xzvf server-jre-7u95-linux-x64.tar.gz -C jre1.7.0_95/
# Directory "jre1.7.0_95/" contains top-level directory "jdk1.7.0_95"

# Let's look at the differences:
$ diff -qr  jdk1.7.0_95     jre1.7.0_95/jdk1.7.0_95/

Only in jdk1.7.0_95/bin: ControlPanel
Only in jdk1.7.0_95/bin: javaws
Only in jdk1.7.0_95/bin: jcontrol
Only in jdk1.7.0_95/bin: jmc
Only in jdk1.7.0_95/bin: jmc.ini
Only in jdk1.7.0_95/jre/bin: ControlPanel
Only in jdk1.7.0_95/jre/bin: java_vm
Only in jdk1.7.0_95/jre/bin: javaws
Only in jdk1.7.0_95/jre/bin: jcontrol
Only in jdk1.7.0_95/jre/lib/amd64: libdeploy.so
Only in jdk1.7.0_95/jre/lib/amd64: libjavaplugin_jni.so
Only in jdk1.7.0_95/jre/lib/amd64: libnpjp2.so
Files jdk1.7.0_95/jre/lib/charsets.jar and jre1.7.0_95/jdk1.7.0_95/jre/lib/charsets.jar differ
Only in jdk1.7.0_95/jre/lib: deploy
Only in jdk1.7.0_95/jre/lib: deploy.jar
Only in jdk1.7.0_95/jre/lib: desktop
Files jdk1.7.0_95/jre/lib/ext/localedata.jar and jre1.7.0_95/jdk1.7.0_95/jre/lib/ext/localedata.jar differ
Only in jdk1.7.0_95/jre/lib/images: icons
Only in jdk1.7.0_95/jre/lib: javaws.jar
Files jdk1.7.0_95/jre/lib/jfxrt.jar and jre1.7.0_95/jdk1.7.0_95/jre/lib/jfxrt.jar differ
Files jdk1.7.0_95/jre/lib/jsse.jar and jre1.7.0_95/jdk1.7.0_95/jre/lib/jsse.jar differ
Only in jdk1.7.0_95/jre/lib: locale
Only in jdk1.7.0_95/jre/lib: plugin.jar
Files jdk1.7.0_95/jre/lib/rt.jar and jre1.7.0_95/jdk1.7.0_95/jre/lib/rt.jar differ
Only in jdk1.7.0_95/jre/lib/security: javaws.policy
Only in jdk1.7.0_95/jre: plugin
Only in jdk1.7.0_95/lib: missioncontrol
Files jdk1.7.0_95/lib/tools.jar and jre1.7.0_95/jdk1.7.0_95/lib/tools.jar differ
Only in jdk1.7.0_95/man/ja/man1: javaws.1
Only in jdk1.7.0_95/man/ja_JP.UTF-8/man1: javaws.1
Only in jdk1.7.0_95/man/man1: javaws.1

# And the size of each:
$ du -sh jdk1.7.0_95/   jre1.7.0_95/jdk1.7.0_95/

301M    jdk1.7.0_95/
235M    jre1.7.0_95/jdk1.7.0_95/

In the end it really depends on your application as to which you should use. For vendor apps. I typically refer to their recommendations. If there are none, I use the JDK simply because it includes more "stuff" which I don't want to find out is needed at some later date as there is no easy way to exercise all use cases of an interactive app.

最后,它实际上取决于您应该使用的应用程序。对于供应商应用程序。我通常会参考他们的建议。如果没有,我使用 JDK 只是因为它包含更多我不想在以后发现需要的“东西”,因为没有简单的方法来练习交互式应用程序的所有用例。