区别:JDK,JRE,JVM,JIT

来源:互联网 发布:网络课程的内容有哪些 编辑:程序博客网 时间:2024/06/15 06:56

JDK:java development kit,oracle(现在是sun)的一个产品,不仅包含了jre,还有compiler,debugger等等,相当于eclipse。

JRE:java runtime environment,就是平常电脑没有java要下载的java程序,把我搞死的那个sas就是通过这个。。。这是为了提供一个统一的平台,让所有java的program或application能运行。

上述这两个,JRE是只用来run 程序的,JDK是用来编译开发的,JDK里有JRE里没有的javac的compiler,只要下了jdk就不用下JRE了。

JVM:java virtue machine,这是jre的一个实例,就是经常说的interpretor。According to Wikipedia:

The JVM, which is the instance of the 'JRE' (Java Runtime Environment), comes into action when a Java program is executed. When execution is complete, this instance is garbage collected. JIT is the part of the JVM that is used to speed up the execution time. JIT compiles parts of the byte code that have similar functionality at the same time, and hence reduces the amount of time needed for compilation.

JIT:just in time,在上边一段有提及,说到这就得说起java program的compilation过程了,上图:

当jvm 做interpretation的时候,发现有部分code是hot spot,于是乎,just-in-time(顾名思义,及时地)发现,然后这段code继续compile到机器码,于是乎,cpu可以干活了,速度显著提高,through this way来优化。(http://nullpointer.debashish.com/primer-difference-between-javac-and-jit)

总结一下,上图(http://javapapers.com/core-java/differentiate-jvm-jre-jdk-jit/)

0 0