Difference between JDK, JRE and JVM

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 ??



JVM Details

The one, who is learning Java language, should know the complete process of JVM, that what are the requirements such as compiler, how to compile, how to execute, what are the steps of execution, etc. to understand and take the feel of the more…

Please follow and like us:

http://www.letustweak.com/tutorials/difference-between-jdk-jre-and-jvm/

原文地址:https://www.cnblogs.com/feng9exe/p/12074703.html

时间: 2024-10-07 21:48:03

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

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

初学JAVA很容易被其中的很多概念弄的傻傻分不清楚,首先从概念上理解一下吧,JDK(Java Development Kit)简单理解就是Java开发工具包,JRE(Java Runtime Enviroment)是Java的运行环境,JVM( java virtual machine)也就是常常听到Java虚拟机.JDK是面向开发者的,JRE是面向使用JAVA程序的用户,上面只是简单的区别,一般网上好多都讲概念,我就不讲了,直接截图应该会更清晰一点,我安装的JDK1.8,效果如图: JDK和J

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

最近要重新抓一下java,大量扫技术文档,保存下来供自己查阅.以下转载自http://www.cnblogs.com/xiaofeixiang/p/4085159.html 初学JAVA很容易被其中的很多概念弄的傻傻分不清楚,首先从概念上理解一下吧,JDK(Java Development Kit)简单理解就是Java开发工具包,JRE(Java Runtime Enviroment)是Java的运行环境,JVM( java virtual machine)也就是常常听到Java虚拟机.JDK是

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

1.开发简单的Java程序过程: 名词解释: JDK:JDK是 Java 语言的软件开发工具包,主要用于移动设备.嵌入式设备上的java应用程序.JDK是整个java开发的核心,它包含了JAVA的运行环境(JVM+Java系统类库)和JAVA工具.没有JDK的话,无法编译Java程序(指java源码.java文件),如果想只运行Java程序(指class或jar或其它归档文件),要确保已安装相应的JRE. JDK包含的基本组件包括: javac – 编译器,将源程序转成字节码 jar – 打包工

【java学习】JDK、JRE、JVM的关系

目录结构: contents structure [-] 什么是JDK,JRE,JVM 安装JDK的时候为什么有两个jre 专用JRE 共用JRE 共用JRE和专用JRE的对比 java的跨平台特性 JDK各个文件的作用 参考文章 1,什么是JDK,JRE,JVM. JDK:java development toolskit,包含java开发工具和jre. JRE:java runtime enviroment,包含java运行环境和jvm. JVM:java virtual machine,j

Java中的JDK,JRE和JVM之间的区别

JDK(Java Development Kit)是针对Java开发员的产品,是整个Java的核心,包括了Java运行环境JRE.Java工具和Java基础类库.Java Runtime Environment(JRE)是运行JAVA程序所必须的环境的集合,包含JVM标准实现及Java核心类库.JVM是Java Virtual Machine(Java虚拟机)的缩写,是整个java实现跨平台的最核心的部分,能够运行以Java语言写作的软件程序.尽管它们看起来差不多,但是它们是不同的针对特定目的的

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 written in high level language cannot be run on any machine directly. First, it needs to be translated into that particular machine language. The javac

Java初学者不得不知的概念,JDK,JRE,JVM的区别?

JVM(Java Virtual Machine Java虚拟机) 可以理解为是一个虚拟出来的计算机,具备着计算机的基本运算方式, 它主要负责将java程序生成的字节码文件解释成具体系统平台上的机器指令. 让具体平台如window运行这些Java程序. JRE(Java Runtime Environment Java运行环境) 包括Java虚拟机(JVM Java Virtual Machine)和Java程序所需的核心类库等, 如果想要运行一个开发好的Java程序,计算机中只需要安装JRE即

认识JDK、JRE、JVM

JDK.JRE.JVM之间的关系: 首先看看JDK与JRE的区别与联系,如下图所示: 由图可知: JDK = JRE + Tools&Tool APIs JDK的核心是Java SE API.JavaSE API是一些预定义的类库,开发人员需要用这些类来访问Java语言的功能.Java SE API包括一些重要的语言结构以及基本图形,网络和文件I/O.我们在自己的程序中,调用前辈们写好的这些Class,来作为我们自己开发的一个基础.当然,现在已经有越来越多的性能更好或者功能更强大的第三方类库供我

JDK,JRE,JVM的区别与联系

很多朋友跟我一样,已经使用Java开发很久了,可是对JDK,JRE,JVM这三者的区别与联系一直都是模模糊糊的,下面我们来总结一下. JDK Java Development ToolKit(Java开发工具包).JDK是整个Java的核心,包括了Java运行环境(Java Runtime Environment),一堆Java工具(javac/java/jdb)和Java基础类库(即Java API包括rt.jar).最流行的JDK是sun公司发布的JDK,除了sun之外,还有好多公司和组织都