本文翻译自:What is the difference between JVM, JDK, JRE & OpenJDK?

What is the difference between JVM , JDK , JRE & OpenJDK ? JVMJDKJREOpenJDK有什么区别?

I was programming in Java and I encountered these phrases, what are the differences among them? 我是用Java编程的,我遇到了这些短语,它们之间有什么区别?


#1楼

参考:https://stackoom.com/question/mS1K/JVM-JDK-JRE和OpenJDK有什么区别


#2楼

JVM is the Java Virtual Machine – it actually runs Java ByteCode. JVM是Java虚拟机 - 它实际上运行Java ByteCode。

JRE is the Java Runtime Environment – it contains a JVM, among other things, and is what you need to run a Java program. JRE是Java运行时环境 - 它包含一个JVM,以及运行Java程序所需的内容。

JDK is the Java Development Kit – it is the JRE, but with javac (which is what you need to compile Java source code) and other programming tools added. JDK是Java开发工具包 - 它是JRE,但是使用javac(这是编译Java源代码所需的)和其他编程工具的添加。

OpenJDK is a specific JDK implementation. OpenJDK是一个特定的JDK实现。


#3楼

JVM is the virtual machine Java code executes on JVM是Java代码执行的虚拟机

JRE is the environment (standard libraries and JVM) required to run Java applications JRE是运行Java应用程序所需的环境(标准库和JVM)

JDK is the JRE with developer tools and documentations JDK是包含开发人员工具和文档的JRE

OpenJDK is an open-source version of the JDK, unlike the common JDK owned by Oracle OpenJDK是JDK的开源版本,与Oracle拥有的常见JDK不同


#4楼

A Java virtual machine (JVM) is a virtual machine that can execute Java ByteCode. Java虚拟机(JVM)是可以执行Java ByteCode的虚拟机。 It is the code execution component of the Java software platform. 它是Java软件平台的代码执行组件。

The Java Development Kit (JDK) is an Oracle Corporation product aimed at Java developers. Java Development Kit(JDK)是针对Java开发人员的Oracle Corporation产品。 Since the introduction of Java, it has been by far the most widely used Java Software Development Kit (SDK). 自Java引入以来,它一直是使用最广泛的Java软件开发工具包(SDK)。

Java Runtime Environment , is also referred to as the Java Runtime, Runtime Environment Java Runtime Environment ,也称为Java Runtime,Runtime Environment

OpenJDK (Open Java Development Kit) is a free and open source implementation of the Java programming language. OpenJDK(Open Java Development Kit)是Java编程语言的免费开源实现。 It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GNU General Public License (GPL) with a linking exception. 这是Sun Microsystems于2006年开始的努力的结果。该实现是根据GNU通用公共许可证(GPL)许可的,具有链接异常。


#5楼

JVM JVM

The Java Virtual Machine (JVM) is the virtual machine that runs the Java bytecodes. Java虚拟机 (JVM)是​​运行Java字节码的虚拟机。 The JVM doesn't understand Java source code; JVM不了解Java源代码; that's why you need compile your *.java files to obtain *.class files that contain the bytecodes understood by the JVM. 这就是为什么你需要编译*.java文件来获取包含JVM理解的字节码的*.class文件。 It's also the entity that allows Java to be a "portable language" ( write once, run anywhere ). 它也是允许Java成为“可移植语言”的实体(只需编写一次,随处运行 )。 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. 实际上,JVM有针对不同系统的特定实现(Windows,Linux,macOS, 请参阅Wikipedia列表 ),目的是使用相同的字节码,它们都会给出相同的结果。

JDK and JRE JDK和JRE

To explain the difference between JDK and JRE, the best is to read the Oracle documentation and consult the diagram: 要解释JDK和JRE之间的区别,最好阅读Oracle文档并参考图表:

Java Runtime Environment (JRE) Java运行时环境(JRE)

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. Java运行时环境(JRE)提供库,Java虚拟机和其他组件来运行用Java编程语言编写的applet和应用程序。 In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; 此外,两个关键的部署技术是JRE的一部分:Java Plug-in,它使applet能够在流行的浏览器中运行; and Java Web Start, which deploys standalone applications over a network. 和Java Web Start,它通过网络部署独立应用程序。 It is also the foundation for the technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment. 它也是用于企业软件开发和部署的Java 2平台企业版(J2EE)中的技术的基础。 The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications. JRE不包含用于开发applet和应用程序的工具和实用程序,如编译器或调试器。

Java Development Kit (JDK) Java开发工具包(JDK)

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. JDK是JRE的超集,包含JRE中的所有内容,以及开发applet和应用程序所需的编译器和调试器等工具。

Note that Oracle is not the only one to provide JDKs. 请注意,Oracle不是唯一提供JDK的人。

OpenJDK OpenJDK的

OpenJDK is an open-source implementation of the JDK and the base for the Oracle JDK. OpenJDK是JDK的开源实现,也是Oracle JDK的基础。 There is almost no difference between the Oracle JDK and the OpenJDK. Oracle JDK和OpenJDK几乎没有区别。

The differences are stated in this blog : 这篇博客中说明了不同之处:

Q: What is the difference between the source code found in the OpenJDK repository, and the code you use to build the Oracle JDK? 问:OpenJDK存储库中的源代码与用于构建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. 答:非常接近 - 我们的Oracle JDK版本构建过程基于OpenJDK 7构建,只添加了几个部分,例如部署代码,其中包括Oracle的Java插件和Java WebStart的实现,以及一些封闭的源代码派对组件,如图形光栅化器,一些开源的第三方组件,如Rhino,以及一些零碎的东西,如附加文档或第三方字体。 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. 展望未来,我们的目的是开源Oracle JDK的所有部分,除了我们考虑商业功能的部分,例如JRockit Mission Control(Oracle JDK中尚未提供),并用开源替代品替换受阻的第三方组件以实现更接近的平价代码库之间。

Update for JDK 11 - An article from Donald Smith try to disambiguate the difference between Oracle JDK and Oracle's OpenJDK : https://blogs.oracle.com/java-platform-group/oracle-jdk-releases-for-java-11-and-later JDK 11的更新 - 来自Donald Smith的文章试图消除Oracle JDK和Oracle的OpenJDK之间的差异: https : //blogs.oracle.com/java-platform-group/oracle-jdk-releases-for-java-11-然后


#6楼

Another aspect worth mentioning: 另一方面值得一提:

JDK (java development kit) JDK(java开发包)

You will need it for development purposes like the name suggests. 您将需要它用于开发目的,如名称所示。

For example: a software company will have JDK install in their computer because they will need to develop new software which involves compiling and running their Java programs as well. 例如:一家软件公司将在他们的计算机上安装JDK,因为他们需要开发新的软件,包括编译和运行他们的Java程序。

So we can say that JDK = JRE + JVM. 所以我们可以说JDK = JRE + JVM。

JRE (java run-time environment) JRE(java运行时环境)

It's needed to run Java programs. 它需要运行Java程序。 You can't compile Java programs with it . 你不能用它编译Java程序。

For example: a regular computer user who wants to run some online games then will need JRE in his system to run Java programs. 例如:想要运行某些在线游戏的普通计算机用户将需要在他的系统中运行JRE来运行Java程序。

JVM (java virtual machine) JVM(java虚拟机)

As you might know it run the bytecodes. 您可能知道它运行字节码。 It make Java platform independent because it executes the .class file which you get after you compile the Java program regardless of whether you compile it on Windows, Mac or Linux. 它使Java平台独立,因为它执行编译Java程序后得到的.class文件,无论您是在Windows,Mac还是Linux上编译它。

Open JDK 打开JDK

Well, like I said above. 好吧,就像我上面说的那样。 Now JDK is made by different company, one of them which happens to be an open source and free for public use is OpenJDK, while some others are Oracle Corporation's JRockit JDK or IBM JDK. 现在JDK是由不同的公司制作的,其中一个恰好是开源的,免费供公众使用的是OpenJDK,而另一些则是Oracle Corporation的JRockit JDK或IBM JDK。

However they all might appear the same to general user. 但是它们对于普通用户来说可能看起来都一样。

Conclusion 结论

If you are a Java programmer you will need JDK in your system and this package will include JRE and JVM as well but if you are normal user who like to play online games then you will only need JRE and this package will not have JDK in it. 如果你是一个Java程序员,你需要在你的系统中使用JDK,这个软件包也包括JRE和JVM,但如果你是喜欢玩在线游戏的普通用户那么你只需要JRE而且这个软件包里面不会有JDK 。

In other words JDK is grandfather JRE is father and JVM is their son. 换句话说,JDK是祖父JRE是父亲而JVM是他们的儿子。

JVM,JDK,JRE和OpenJDK有什么区别?相关推荐

  1. Java三大版本及 JVM JDK JRE 及 SDK API

    目录 1.三大版本 2. JDK JRE JVM 3. SDK API 1.三大版本 JavaSE: 标准版,整个Java的基础及核心,主要用于开发桌面程序及控制台程序. JavaME: 移动版,基本 ...

  2. JVM JDK JRE JSE的简单介绍

    java是面向对象编程,一切皆对象.这个观念要以后慢慢才能了解,无论怎么样讲都是初学者理解不了的.所以还需要多多练习. C语言是面向过程编程的.所以没有"类"的概念,而java的类 ...

  3. JVM/JDK/JRE/IDE—区别

    1..JVM -- java virtual machine        JVM就是我们常说的java虚拟机,它是整个java实现跨平台的最核心的部分,所有的java程序会首先被编译为.class的 ...

  4. JDK, JRE和JVM的区别与联系

    #####JDK: java development kit, java开发工具包,针对开发者,里面主要包含了jre, jvm, jdk源码包,以及bin文件夹下用于开发,编译运行的一些指令器. ## ...

  5. JDK, JRE 和JVM的区别

    2019独角兽企业重金招聘Python工程师标准>>> Java 开发工具包 (JDK) Java开发工具包是Java环境的核心组件,并提供编译.调试和运行一个Java程序所需的所有 ...

  6. POPTEST老李谈JVM、JRE、JDK、java ee sdk with jdk区别

    POPTEST老李谈JVM.JRE.JDK.java ee sdk with jdk区别 poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作 ...

  7. JDK,JRE,JVM区别与联系

    很多朋友可能跟我一样,已经使用JAVA开发很久了,可是对JDK,JRE,JVM这三者的联系与区别,一直都是模模糊糊的. 今天特写此文,来整理下三者的关系. JDK : Java Development ...

  8. Java中JVM、JRE和JDK三者有什么区别和联系?

    Java 语言的开发运行,离不开 Java 语言的运行环境 JRE.没有 JRE 的支持,Java 语言便无法运行.当然,如果还想编译 Java 程序,小项目开发的话,JRE 是明显不够了,这时候就需 ...

  9. Java教程:Java中JVM、JRE和JDK三者有什么区别和联系?

    本篇文章由 泉州SEO www.234yp.com 整理发布,Java教程 www.234yp.com/Article/198121.html 谢谢合作! Java教程任何语言或者软件的运行都需要环境 ...

最新文章

  1. 如何实现phpcms v9_4X版本tag的伪静态?
  2. pythopn 迭代器
  3. React.js 小书 Lesson12 - state vs props
  4. HDU4473_Exam
  5. 汉克尔变换matlab,HankelTransform
  6. CF1422F Boring Queries(ST表 + 主席树)
  7. ListString^^ 引用空间
  8. 重庆高职高专计算机排名,重庆十大大专排名(含分数线2021年参考)-重庆最好的全日制专科学校...
  9. CUDA和LAPACK混编的MakeFile文件
  10. cpu性能参数如何看?
  11. CSS中文手册下载、使用技巧(附下载链接,压缩包被禁用了)
  12. 硬件编程-----根据时序图写C语言驱动
  13. 浅谈Spring @Order注解的使用
  14. 百度统计 页面代码安装状态:代码未生效 解决
  15. 计算机组成原理实验五:CPU组成与机器指令执行实验
  16. TPC-H系列---2---TPC-H表结构及表之间的关系
  17. Linux下的PCI总线驱动
  18. 旧金山大学 计算机,旧金山大学
  19. 还能用中文写代码?东北话:我先来整一个
  20. iOS 模拟器网络设置

热门文章

  1. 算法-- 找到所有数组中消失的数字(Java)
  2. 算法----- 给定一颗二叉树,找到二叉树上任意两个节点之间的距离(Java版本)
  3. Java、Android静态代理与动态代理
  4. JNI中C调用Java方法
  5. mysql 大量数据 更改索引_Mysql索引数据结构详解与索引优化
  6. Android之GSON解析JSON
  7. python程序员面试宝典 勘误_《前端面试江湖》勘误合集(二)
  8. labview初始学习过程中遇到串口读取框红蓝色交替闪烁的处理
  9. HTML页面中点击按钮关闭页面几种方式与取消
  10. uiwebview 加载本地js、css、img,html从网站加载