Jvm vs jre vs jdk | difference between jvm, jre and jdk

2
JVM VS JRE VS JDK The jvm vs jre vs jdk tutorial explains the difference between jvm, jre and jdk for beginners. You may check this video also to understand the difference between jvm, jre and jdk. 1) JVM (Java Virtual Machine) JVM stands for Java Virtual Machine. It simulates a real computer and provides the runtime environment for running java applications. In the first step, the java source code is converted to a byte code (binary code that can be understood by the JVM: instruction set of the JVM) by the java compiler (javac). This byte code is converted by the JVM into a machine code (binary). Then, the machine code is run by the computer that has the JRE installed. Actually, JVM interprets the byte code and runs the java program. It uses the class libraries, and other files provided in JRE in order to accomplish this task. 2) JRE (Java Runtime Environment) JRE is an acronym of Java Runtime Environment. Java Runtime Environment is an executable file that includes JVM, class libraries (util, math,etc), and other files. JRE doesn’t include any development tool like compiler, debugger, etc. JRE = JVM + Java standard classes (math, lang, util, etc) + runtime libraries JREs are available for download in Oracle website. There are many versions for each hardware configuration (32 bits/ 64 bits) or operating system (windows, linux, Mac OS, etc). 3) JDK (Java Development Kit) JDK stands for Java Development Kit. It is an executable or a set of tools created by sun Microsystems that is used for creating java application.

Transcript of Jvm vs jre vs jdk | difference between jvm, jre and jdk

JVM VS JRE VS JDK

The jvm vs jre vs jdk tutorial explains the difference between jvm, jre and jdk for

beginners.

You may check this video also to understand the difference between jvm, jre and jdk.

1) JVM (Java Virtual Machine)

JVM stands for Java Virtual Machine. It simulates a real computer and provides the

runtime environment for running java applications.

In the first step, the java source code is converted to a byte code (binary code that can

be understood by the JVM: instruction set of the JVM) by the java compiler (javac).

This byte code is converted by the JVM into a machine code (binary). Then, the machine

code is run by the computer that has the JRE installed.

Actually, JVM interprets the byte code and runs the java program.

It uses the class libraries, and other files provided in JRE in order to accomplish this task.

2) JRE (Java Runtime Environment)

JRE is an acronym of Java Runtime Environment.

Java Runtime Environment is an executable file that includes JVM, class libraries (util,

math,etc), and other files.

JRE doesn’t include any development tool like compiler, debugger, etc.

JRE = JVM + Java standard classes (math, lang, util, etc) + runtime libraries

JREs are available for download in Oracle website. There are many versions for each

hardware configuration (32 bits/ 64 bits) or operating system (windows, linux, Mac OS,

etc).

3) JDK (Java Development Kit)

JDK stands for Java Development Kit.

It is an executable or a set of tools created by sun Microsystems that is used for

creating java application.

JDK=JRE+ java compiler (javac) + debugger + other development tools.

Please feel free to check this tutorial in order to install java development environment.

1) Why JAVA is platform independent?

The JVM is platform dependant whereas our java code is platform independent.

The java compiler (javac) converts the source code into a byte code.

The byte code is a special binary code that the JVM can understand. It is written using

the instruction set of the JVM.

When we double click an executable java executable file, the jvm converts the byte code

present in the executable file into a binary code that can be run by the host computer.

Then, the program is loaded into the RAM of the host computer and executed.

The scenario is true when we are not using the JIT compiler (Just In Time Compiler).

You can check what is a JIT compiler in these core java interview questions.

The Java executable file for desktop applications is an executable Jar (Java Archive).

This Jar file is an archive (a compressed file that contains .class files). You can unzip it

like any rar or zip archive.

We can break platform independency when we write a program that looks for specific OS

related files or when using JNI (Java Native Interface).

This java tutorial which explains the difference between jvm, jre and jdk arrives at its end.

You may also check the difference between jvm, jre and jdk online for more details.

To check the other tutorials that deal with core java, please check our core java tutorial .

Please, don’t forget to follow us on our how to program Facebook page to get our next java

tutorial.