jdk和jre和jvm区别_JDK,JRE和JVM之间的区别

jdk和jre和jvm区别

The difference between JDK and JRE and JVM is one of the popular interview questions. You might also be asked to explain JDK vs JRE vs JVM.

JDK与JRE和JVM之间的区别是流行的面试问题之一。 可能还会要求您解释JDK,JRE和JVM。

JDK与JRE和JVM之间的区别 (Difference between JDK and JRE and JVM)

JDK, JRE, and JVM are core concepts of Java programming language. Although they all look similar and as a programmer, we don’t care about these concepts a lot, but they are different and meant for specific purposes. It’s one of the common java interview questions and this article will explain each one of these and what is the difference between them.

JDK,JRE和JVM是Java编程语言的核心概念。 尽管它们看上去都是相似的,并且作为程序员,但是我们并不太在乎这些概念,但是它们是不同的,并且针对特定目的。 这是常见的Java面试问题之一 ,本文将解释每个问题以及它们之间的区别。

JDK (JDK)

Java Development Kit is the core component of Java Environment and provides all the tools, executables and binaries required to compile, debug and execute a Java Program. JDK is a platform-specific software and that’s why we have separate installers for Windows, Mac, and Unix systems. We can say that JDK is the superset of JRE since it contains JRE with Java compiler, debugger, and core classes. The current version of JDK is 11 also known as Java 11.

Java Development Kit是Java Environment的核心组件,并提供编译,调试和执行Java程序所需的所有工具,可执行文件和二进制文件。 JDK是特定于平台的软件,因此我们为Windows,Mac和Unix系统提供了单独的安装程序。 可以说JDK是JRE的超集,因为它包含带有Java编译器,调试器和核心类的JRE。 JDK的当前版本为11,也称为Java 11

虚拟机 (JVM)

JVM is the heart of Java programming language. When we run a program, JVM is responsible for converting Byte code to the machine specific code. JVM is also platform dependent and provides core java functions like memory management, garbage collection, security etc. JVM is customizable and we can use java options to customize it, for example allocating minimum and maximum memory to JVM. JVM is called virtual because it provides an interface that does not depend on the underlying operating system and machine hardware. This independence from hardware and the operating system is what makes java program write-once-run-anywhere.

JVM是Java编程语言的核心。 当我们运行程序时,JVM负责将Byte代码转换为机器特定的代码。 JVM也是平台相关的,并提供诸如内存管理,垃圾回收,安全性等核心Java功能。JVM是可自定义的,我们可以使用java选项对其进行自定义,例如为JVM分配最小和最大内存。 JVM之所以称为虚拟的,是因为它提供的接口不依赖于底层操作系统和机器硬件。 这种与硬件和操作系统的独立性使得Java程序可以在任何地方编写一次写入。

杰瑞 (JRE)

JRE is the implementation of JVM, it provides a platform to execute java programs. JRE consists of JVM and java binaries and other classes to execute any program successfully. JRE doesn’t contain any development tools like java compiler, debugger etc. If you want to execute any java program, you should have JRE installed but we don’t need JDK for running any java program.

JRE是JVM的实现,它提供了执行Java程序的平台。 JRE由JVM和Java二进制文件以及其他类组成,可以成功执行任何程序。 JRE不包含Java编译器,调试器等任何开发工具。如果您想执行任何Java程序,则应该安装JRE,但我们不需要JDK即可运行任何Java程序。

JDK,JRE和JVM (JDK vs JRE vs JVM)

Let’s look at some of the important difference between JDK, JRE, and JVM.

让我们看一下JDK,JRE和JVM之间的一些重要区别。

  1. JDK is for development purpose whereas JRE is for running the java programs.

    JDK用于开发目的,而JRE用于运行Java程序。
  2. JDK and JRE both contains JVM so that we can run our java program.

    JDK和JRE都包含JVM,因此我们可以运行我们的java程序。
  3. JVM is the heart of java programming language and provides platform independence.

    JVM是Java编程语言的核心,并提供平台独立性。

即时编译器(JIT) (Just-in-time Compiler (JIT))

Sometimes we heard this term and being it a part of JVM it confuses us. JIT is part of JVM that optimizes byte code to machine specific language compilation by compiling similar byte codes at the same time, hence reducing overall time taken for the compilation of byte code to machine specific language.

有时我们听到这个术语,并且它成为JVM的一部分使我们感到困惑。 JIT是JVM的一部分,它通过同时编译相似的字节码来优化字节码以进行机器特定语言的编译,从而减少了将字节码编译为机器特定语言所需的总时间。

翻译自: https://www.journaldev.com/546/difference-jdk-vs-jre-vs-jvm

jdk和jre和jvm区别

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值