With Java programming language, the three terms i.e. JDK, JRE and JVM will always be there to understand the difference between them. If you area Java developer, it is very important to know about these core concepts of Java language. Once, if you understand these things, then it would be quite easy for you to visualize things in logical manner.

So let’s begin to understand each term one by one in order to know the actual role of the three concepts.

JDK (Java Development Kit)

JDK is abbreviation of Java Development kit which is the core component of Java environment. It is a kit that is the combination of developing tools to develop Java programs and JRE (Java Runtime Environment) to run the programs.

  • The developing tools includes compiler (javac.exe), Java application launcher (java.exe), Applet-viewer, etc.

    • Compiler converts Java programs into byte code.
    • Java application launcher opens JRE, loads the class, and invokes its main method.
  • JRE is used to run the Java programs.

JDK is necessary for writing and compiling the Java program. But for running Java program, JRE is sufficient. As JRE is targeted for execution of Java files i.e. JRE = JVM + Java Packages Classes (such as util, lang, math, awt, swing, etc.) + Runtime libraries.

JDK is mainly targeted for Java development, i.e. you can create Java file (with the help of Java packages), compile a Java file, and run a Java file (with the help of JRE).

JDK is platform specific software and that is why we have separate installers for Windows, Mac and UNIX systems. We can say that JDK is superset of JRE since it contains JRE with Java compiler, debugger and core classes. Current version of JDK is 1.7 also known as Java 7.

JRE (Java Runtime Environment)

JRE is the abbreviation of Java Runtime Environment that is used to provide the runtime environment to the Java programs. JRE is smaller than JDK, so it needs less disk space and it is so because JRE does not contains and development tools such as compiler, debugger, etc.

JRE contains JVM, set of class libraries, and other supporting files. Actually, JRE is the implementation of JVM, as JVM runs the program by using class libraries and other files provided in JRE. If you only want to run any Java program, you should have JRE installed in the system, but we don’t need JDK to run any Java program.

JVM (Java Virtual Machine)

JVM is the abbreviation of Java Virtual Machine which is considered as the heart of Java programming language. It is also an abstract machine. It is a specification that provides the runtime environment in which Java byte code can be executed.

JVM (Virtual)

A Java program execution uses both, compilation and interpretation. Java programs are compiled into machine language, but it is a machine language for a computer that is, virtual and doesn’t really exists. This so-called “virtual” computer is known as the Java virtual machine.

                                                                                        OR

The JVM is called as “virtual”, because the machine interface that does not depend on the underlying operating system and machine hardware architecture. This independence from hardware and operating system is a corner-stone of “Write Once Run Anywhere (WORA)” value of Java program.

The machine language for the JVM (Java Virtual Machine) is called the Java byte code.”

As we all know that, when a Java file is compiled, output is not an “.exe” file but it’s a “.class” file, and .class file consists of Java byte code which is understandable by JVM. It interprets the byte code into machine code depending upon the underlying operating system and hardware combination. It is responsible for all the things like garbage collection, array bounds checking, security, memory management, etc. JVM is also customizable and we use Java option to customize it, for example minimum or maximum memory to JVM.

The JVM is written for each platform supported by Java included in the Java Runtime Environment (JRE). The Oracle JVM is written in the C programming language. There are many JVM implementations developed by different organizations. They may somewhat differ in performance, reliability, speed and so on. They can too differ in implementation especially in those features where Java specification does not mention implementation details of the feature. Garbage collection is the nice example which is left on vendor’s choice and Java specification does not provide any implementation details.

JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.”

JDK vs JRE vs JVM

JIT (Just in Time Compiler)

JIT is the name of the compiler that is a part of JVM. It is an advance compiler which is used by JVM to optimize byte code into machine specific language by compiling similar byte code at same time and thus reduces the overall execution time. It also performs other optimizations such as in-lining function.

Relations between JDK, JRE, and JVM

Thank you for your patience

Difference between JDK, JRE and JVM的更多相关文章

  1. java学习之Java中JDK,JRE和JVM之间的关系(转载)

    最近要重新抓一下java,大量扫技术文档,保存下来供自己查阅.以下转载自http://www.cnblogs.com/xiaofeixiang/p/4085159.html 初学JAVA很容易被其中的 ...

  2. Java中JDK,JRE和JVM之间的关系

    初学JAVA很容易被其中的很多概念弄的傻傻分不清楚,首先从概念上理解一下吧,JDK(Java Development Kit)简单理解就是Java开发工具包,JRE(Java Runtime Envi ...

  3. Java基础知识 ——JDK,JRE和JVM

    1.开发简单的Java程序过程: 名词解释: JDK:JDK是 Java 语言的软件开发工具包,主要用于移动设备.嵌入式设备上的java应用程序.JDK是整个java开发的核心,它包含了JAVA的运行 ...

  4. Java中JDK,JRE和JVM之间的关系-(转载)

    初学JAVA很容易被其中的很多概念弄的傻傻分不清楚,首先从概念上理解一下吧,JDK(Java Development Kit)简单理解就是Java开发工具包,JRE(Java Runtime Envi ...

  5. JAVA语言的跨平台性和JDK,JRE与JVM

    Java虚拟机--JVM ~JVM:java虚拟机简称JVM是运行所有java程序的假想计算机,是java程序的运行环境,是java最具有吸引力的特性之一,我们编写的java代码,都运行在JVM之上 ...

  6. 【java】JDK、JRE、JVM的关系

    目录结构: contents structure [-] 什么是JDK,JRE,JVM 安装JDK的时候为什么有两个jre 专用JRE 共用JRE 共用JRE和专用JRE的对比 java的跨平台特性 ...

  7. Java Virtual Machine (JVM), Difference JDK, JRE & JVM – Core Java

    By Chaitanya Singh | Filed Under: Learn Java Java is a high level programming language. A program wr ...

  8. JDK,JRE,JVM,三者的区别于联系?

    万事开头难,从基础抓起! 下载JDK官网:http://www.oracle.com/technetwork/java/javase/downloads/index.html JDK:Java Dev ...

  9. java环境变量以及jdk、jre、jvm

    一.jdk,jre,jvm的了解:jdk全称java development kit即java开发工具包,是整个java的核心,包含了java运行环境jre.java工具包和java的基础类库: jr ...

随机推荐

  1. python利用setsockopt获得端口重用

    server.setsockopt(SOL_SOCKET,SO_REUSEADDR,1) 假如端口呗socket使用过,并且利用socket.close()来关闭连接,但此时端口还没有释放,要经过一个 ...

  2. 《Java基础知识》Java成员变量,成员方法,构造方法和析构方法

    一 成员变量 成员变量是指类的一些属性定义,标志类的静态特征,它的基本格式如下: [访问修饰符][修饰符][类型][属性名称]= [初始值] 访问修饰符:public(公共的):protected(受 ...

  3. 一起学Spring之注解和Schema方式实现AOP

    概述 在上一篇,我们了解了通过实现接口和XML配置的方式来实现AOP,在实现注解方式AOP之前,先了解一下AspectJ.AspectJ是一个面向切面的框架,它扩展了Java语言,定义了AOP语法,能 ...

  4. javascript for循环+异步请求导致请求顺序不一致

    工作中遇到一个问题 for循环,再把循环出来的ID再进行二次请求 这就导致一个问题 请求结果返回顺序不一致 原因:异步请求会把回调事件放入微任务事件队列,宏任务执行完毕再执行微任务,具体参考事件队列机 ...

  5. linux下安装与配置nfs服务器

    NFS 什么是NFS?(NAS) NFS(网络文件系统):它的主要功能是通过网络让不同的机器系统之间可以彼此共享文件和目录.NFS服务器可以允许NFS客户端将远端NFS服务器端的共享目录挂载到本地的N ...

  6. WebAPI接口测试数据库操作

    通常我们是不建议直接查看数据库内容来检查功能的,但是在没有外部接口或者图形界面验证的情况下,只能通过查询数据库来验证. 比如我们手工需要从界面上添加一万条数据,估计要花好几天时间,显然不能手工去操作. ...

  7. IT兄弟连 HTML5教程 DIV+CSS网站首页布局示例

    首页的设计直接影响网站的整体形象,虽然没有一个统一的规范,但最好将其设计为大众化的,只要信息内容能够合理地编排即可,使用户可以方便地找到需要的信息.另外,首页的高度最好不要超过三个屏幕,页面中使用的颜 ...

  8. Jmeter脚本参数化和正则匹配

    我们在做接口测试过程中,往往会遇到以下几种情况 每次发送请求,都需要更改参数值为未使用的参数值,比如手机号注册.动态时间等 上一个接口的请求体参数用于下一个接口的请求体参数 上一个接口的响应体参数用于 ...

  9. MongoDB(四):数据类型、插入文档、查询文档

    1. 数据类型 MongoDB支持许多数据类型. 字符串 - 这是用于存储数据的最常用的数据类型.MongoDB中的字符串必须为UTF-8. 整型 - 此类型用于存储数值. 整数可以是32位或64位, ...

  10. FCC---CSS Flexbox: Apply the flex-direction Property to Create Rows in the Tweet Embed

    The header and footer in the tweet embed example have child items that could be arranged as rows usi ...