有什么区别JVM,JDK,JRE& OpenJDK的? [英] What is the difference between JVM, JDK, JRE & OpenJDK?

查看:366
本文介绍了有什么区别JVM,JDK,JRE& OpenJDK的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JVM JDK JRE & OpenJDK

我是用Java编程的,我遇到了这些短语,它们之间有什么区别?

I was programming in Java and I encountered these phrases, what are the differences between them?

推荐答案

JVM



Java虚拟机(JVM)是​​虚拟的运行Java字节码的机器。 JVM不了解Java源代码;这就是为什么要编译 *。java 文件以获取 * .class 包含JVM理解的字节码的文件。它也是允许Java成为可移植语言的实体(一次编写,随处运行)。实际上,JVM有针对不同系统的特定实现(Windows,Linux,macOS,查看维基百科列表),目的是使用相同的字节码,它们都给出相同的结果。

JVM

The Java Virtual Machine (JVM) is the virtual machine that runs the Java bytecodes. The JVM doesn't understand Java source code; that's why you compile your *.java files to obtain *.class files that contain the bytecodes understood by the JVM. It's also the entity that allows Java to be a "portable language" (write once, run anywhere). Indeed, there are specific implementations of the JVM for different systems (Windows, Linux, macOS, see the Wikipedia list), the aim is that with the same bytecodes they all give the same results.

为了解释JDK和JRE之间的区别,最好是阅读 Oracle文档并参考图表:

To explain the difference between JDK and JRE, the best is to read the Oracle documentation and consult the diagram:


Java运行时环境(JRE)

Java运行时环境(JRE)提供库,Java虚拟机和其他组件来运行用Java编程语言编写的applet和应用程序。此外,两个关键的部署技术是JRE的一部分:Java Plug-in,它使applet能够在流行的浏览器中运行;和Java Web Start,它通过网络部署独立应用程序。它也是用于企业软件开发和部署的Java 2平台企业版(J2EE)中的技术的基础。 JRE不包含用于开发applet和应用程序的工具和实用程序,如编译器或调试器。

The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; and Java Web Start, which deploys standalone applications over a network. It is also the foundation for the technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment. The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.

Java Development Kit(JDK)

JDK是JRE的超集,包含JRE中的所有内容,以及开发applet和应用程序所需的编译器和调试器等工具。

The JDK is a superset of the JRE, and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications.

请注意,Oracle不是唯一提供JDK的人。

Note that Oracle is not the only one to provide JDKs.

OpenJDK 是一个JDK的开源实现和Oracle JDK的基础。 Oracle JDK和OpenJDK之间几乎没有区别。

OpenJDK is an open-source implementation of the JDK and the base for the Oracle JDK. There is almost no difference between the Oracle JDK and the OpenJDK.

这个差异在博客


问:OpenJDK存储库中的源代码与用于构建Oracle JDK的代码有什么区别?

Q: What is the difference between the source code found in the OpenJDK repository, and the code you use to build the Oracle JDK?

答:这是非常的close - 我们的Oracle JDK版本构建过程基于OpenJDK 7构建,只添加了几个部分,例如部署代码,其中包括Oracle的Java插件和Java WebStart实现,以及一些封闭源第三方组件,如图形rasterizer,一些开源的第三方组件,如Rhino,以及一些零碎的部分,如附加文档或第三方字体。展望未来,我们的目的是开源Oracle JDK的所有部分,除了我们考虑商业功能的部分,例如JRockit Mission Control(Oracle JDK中尚未提供),并用开源替代品替换受阻的第三方组件以实现更接近的平价在代码库之间。

A: It is very close - our build process for Oracle JDK releases builds on OpenJDK 7 by adding just a couple of pieces, like the deployment code, which includes Oracle's implementation of the Java Plugin and Java WebStart, as well as some closed source third party components like a graphics rasterizer, some open source third party components, like Rhino, and a few bits and pieces here and there, like additional documentation or third party fonts. Moving forward, our intent is to open source all pieces of the Oracle JDK except those that we consider commercial features such as JRockit Mission Control (not yet available in Oracle JDK), and replace encumbered third party components with open source alternatives to achieve closer parity between the code bases.

这篇关于有什么区别JVM,JDK,JRE& OpenJDK的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆