Differentiate JVM JRE JDK JIT

10/05/2009

Java Virtual Machine (JVM) is an abstract computing machine. Java Runtime Environment (JRE) is an implementation of the JVM. Java Development Kit (JDK) contains JRE along with various development tools like Java libraries, Java source compilers, Java debuggers, bundling and deployment tools.

JVM becomes an instance of JRE at runtime of a java program. It is widely known as a runtime interpreter. The Java virtual machine (JVM) is the cornerstone on top of which the Java technology is built upon. It is the component of the Java technology responsible for its hardware and platform independence. JVM largely helps in the abstraction of inner implementation from the programmers who make use of libraries for their programmes from JDK.

Diagram to show the relations between JVM JRE JDK

Diagram to show the relations between JVM JRE JDK

JVM Internals

Like a real computing machine, JVM has an instruction set and manipulates various memory areas at run time. Thus for different hardware platforms one has corresponding implementation of JVM available as vendor supplied JREs. It is common to implement a programming language using a virtual machine. Historicaly the best-known virtual machine may be the P-Code machine of UCSD Pascal.

A Java virtual machine instruction consists of an opcode specifying the operation to be performed, followed by zero or more operands embodying values to be operated upon. From the point of view of a compiler, the Java Virtual Machine (JVM)is just another processor with an instruction set, Java bytecode, for which code can be generated. Life cycle is as follows, source code to byte code to be interpreted by the JRE and gets converted to the platform specific executable ones.

Sun’s JVM

Sun’s implementations of the Java virtual machine (JVM) is itself called as JRE. Sun’s JRE is availabe as a separate application and also available as part of JDK. Sun’s Java Development Tool Kit (JDK) comes with utility tools for byte code compilation “javac”. Then execution of the byte codes through java programmes using “java” and many more utilities found in the binary directory of JDK. ‘java’ tools forks the JRE. Implementation of JVMs are also actively released by other companies besides Sun Micro Systems.

JVM for other languages

A JVM can also be used to implement programming languages other than Java. For example, Ada source code can be compiled to Java bytecode, which may then be executed by a Java virtual machine (JVM). That is, any language with functionality that can be expressed in terms of a valid class file can be hosted by the Java virtual machine (JVM). Attracted by a generally available, machine-independent platform, implementors of other languages are turning to the Java virtual machine (JVM) as a delivery vehicle for their languages. PHP with Quercus is such an example.

Just-in-time Compiler (JIT)

JIT is the part of the Java Virtual Machine (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. Here the term “compiler” refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU.

Hi Joe,

Explanation on each are really good.

Thanks and Regards
Srikanth S

Srikanth S on May 11th, 2010 2:48 pm

Thanks Srikanth.

Joe on May 11th, 2010 9:58 pm

The picture about the implementation is good. However, I read in the first paragrapth tha JRE is an implementation of JVM and in the very next the I read the reverse of it.

Can you confirm if JRE is the implementation of JVM or JVM is the implementation of JRE?

Also, if JRE is an implementation of JVM, then I assue [JDK, JIT, Compiler] will all come under JDK.

Please confirm my understanding.

Shreyas on July 9th, 2010 7:45 pm

What you read in the first paragraph and in the next paragraph means the same.

“Java Runtime Environment (JRE) is an implementation of the JVM”. “JVM becomes an instance of JRE at runtime”. These are the two statements you are referring to.

They mean the same. If the second statement is confusing to understand the relationship between jvm and jre, just ignore it. If you understand the larger picture that “Java Runtime Environment (JRE) is an implementation of the JVM” is good.

Over a period, you will digest the complete relationship and difference between jre and jvm.

Joe on July 10th, 2010 3:39 am

Realy a nice Explainasion ………

Anonymous on July 21st, 2010 7:03 am

I like ur explainasion…..it realy anice one….thnks 4 it.

Amol Bhuibhar on July 21st, 2010 7:04 am

The information is really help. Good Work

Mahesh on August 12th, 2010 5:40 pm

The explaination given is really very good. reading it my most of the concepts are more clear nwo.Thanks

pooja on September 15th, 2010 8:02 am

JIT is the part of the Java Virtual Machine (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. Here the term “compiler” refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU.

CHAITALI JADHAV on September 16th, 2010 3:52 am

Dear sir,
I am pankaj kumat jha and read and learn full information about jvm,jre,jit in detail with diagram and really gg

pankaj on November 25th, 2010 1:56 pm

good explanaton….
i want to seperate jre from the given java software.. is this possible???

santhosh on December 13th, 2010 3:20 pm

Good explanation!!!

Shyam on January 13th, 2011 9:26 am

nice explanation ….with pictures

Thimmappa on March 4th, 2011 11:38 am

nice explanation ……with picture….it is so helpful……

Thimmappa on March 4th, 2011 11:38 am

nice

dk on March 7th, 2011 5:49 pm

simple and easy to understand explanation.

Vinay on March 9th, 2011 4:00 pm

I love the pictorial way of explaining it. Thanks.

kk on March 19th, 2011 11:58 am

really nice description……..

Goutam Sikder on March 22nd, 2011 6:43 am

your information really help me for knowing the internal working of jvm & all other..!!!
Thank u

Abhi on March 26th, 2011 1:15 pm

very nice description. Provide some data for java IO stream classes…..

Prerna on April 12th, 2011 12:19 pm

thank u…gud explanation…:)

Anonymous on April 20th, 2011 4:39 am

thanks very much

PRIYA on April 23rd, 2011 5:46 pm

Thank you, This is the really good explation with the pictures

Tushar Singh on May 21st, 2011 4:57 am

I have a doubt…

Java Virtual Machine (JVM) is interpreter But Just-in-time Compiler is the compiler.. Why both Interpreter and Compiler both are needed?
What Functions are done by JVM and what are done by JIT?

vt on May 22nd, 2011 12:49 pm

thaks… its really usefull..

Manu on June 9th, 2011 6:00 am

In the Diagram what is meant by java compiler is it not at all related to Jvm?

Divya on June 9th, 2011 11:10 am

Thanks a ton dewd…

peace!

gautam on June 12th, 2011 8:21 am

not very clear specification,but good effort

Ankit Sharma on June 29th, 2011 7:15 am

hello sir, Your explanations are very nice and they are easy to understand

rajasekhar on July 13th, 2011 9:47 am

thanks shrikant

TAPAN on August 2nd, 2011 5:42 am

well… i love the way you explore things….
thanks a lot sir for providing us such a good information of Java..

Abhishek kumar verma on August 8th, 2011 9:13 am

gr8 explanation… just loved it.. :)

shri on September 21st, 2011 5:51 pm

hiiiiiii,,,,.
i got a Question in test.that is
what is JVM.JVM is Compiler or
interpreter

Ram patidar on October 30th, 2011 8:10 pm

Hi Sir,
your Explanation about jvm,jre are very excelent sir..

thank you

chandu on November 10th, 2011 5:10 pm

hii…..joe…thnx for explntion….
it was gr8…..thnx again..

Durgesh on November 15th, 2011 9:40 am

nice explanation with diagram

venkat on November 18th, 2011 6:29 am

NICE EXPLANATION WITH DIAGRAMI

GOSWAMI SANJAYPURI on November 23rd, 2011 7:47 am

[...] binary files are used in a java virtual machine for execution. Java bytecode (instruction to JVM) are interpreted using JVM directly. Latest [...]

Java Binary&hellip on November 27th, 2011 11:25 pm

Thanks… Short and Sweet.

John Jai on November 30th, 2011 1:12 pm

super explanation

Anonymous on December 1st, 2011 8:11 am

Good explanation

Preetha on December 1st, 2011 9:09 am

hi…
Explanation on each are really very
good.

Thanks and Regards

amar bhukya on December 6th, 2011 6:56 pm

Amazing!

Vivek on December 8th, 2011 12:35 pm

Hi Joe…..your way of explanation is good but still there is a little bit confusion in my mind that what do you mean by jre is instantiate of jvm at runtime and how a java application can access OS library function…..Will you please more elaborate it for me???

Shishir Gupta on December 15th, 2011 1:37 pm

good instruction for people like me who or new to java.KIU joe

ZAFF on December 17th, 2011 4:25 pm

joe,
nice explanation man.
tahnks

manasi on December 28th, 2011 10:25 am

your teching is simply super very use full

Himakumar on December 28th, 2011 2:53 pm

Simply awesome sir, this site is informative, keep doing it sir. :)

Arun K on January 7th, 2012 8:07 am

Very Nice Explanation.
I Have 1 Doubt…
Who calls Main method compiler or Interpreter???

Kiran Kadav on January 8th, 2012 2:27 pm

Thank u for ur answer sir..
Plz post me new blogs of u..

Karpagavalli on January 16th, 2012 8:31 pm

Thanks sir…..
Nice Explanation.

Nigam on January 18th, 2012 8:11 pm

[...] the above two phases are complete, java virtual machine [...]

JVM Shutdown Hook&hellip on January 23rd, 2012 4:59 am

Nice explanation.
Thanks for the article Joe!

Rajesh on January 23rd, 2012 12:08 pm

excellent explanation

thank you sir

chandrashekar

chandrashekar on January 27th, 2012 3:56 pm

i want to become a java developer…how to i learn the java in easy way?please tell me

karthik on January 28th, 2012 10:08 am

nice material

Anonymous on February 3rd, 2012 3:19 pm

nice

siva on February 6th, 2012 2:31 pm

really nice and usefull to us thank you :)

venkateshan on February 10th, 2012 1:39 pm

This website is really nice.It’s very helpful for pepole who are learning java.

padma on February 14th, 2012 11:19 pm

Hi Joe ,

The article is nice.

Can you tell me that, which one among three of them is plat form independent and plateform dependent (JRE,JVM,JDK).

waiting for your replay.

Thanks,
Anurag

anurag on February 16th, 2012 11:22 am

Is JVM is platform independent?

Amit on February 23rd, 2012 5:40 pm

hi Joy,
Thanks for good explanation.

Jitendra on February 27th, 2012 3:47 am

nice,
thanks for good explanation.

jamalaiah on March 18th, 2012 9:27 am

i want ur core java total information

veera on March 21st, 2012 12:39 pm

nice explanation…

Anonymous on March 21st, 2012 1:05 pm

jdk is used for compilation of source code?

shekhar tyagi on March 24th, 2012 11:56 am

really to the point answer

santosh nikam on April 6th, 2012 9:37 pm

It’s Like Simple Formula To Understand These Major Components Of Java…Well Explained Joe! quite helpful…..
Yns…

Anonymous on April 10th, 2012 2:11 am

[...] object can be customized. out gets initialized by java runtime environment at startup and it can be changed by developer during execution. Instead of standard output, in [...]

System.out.println | All &hellip on May 1st, 2012 7:49 am

Sir ..
jdk makes class file into bye code.
so jdk acts as a compiler.

which one acts as a interpreter..? jre or jvm?
what do jvm and jre do?
is jvm equipped with jre?

Replu pls sir..thanks in advance…

Prabu on May 13th, 2012 9:57 am

Hello Where is My previous comments………..?

Prabu on May 13th, 2012 6:43 pm

Where is my previous questions posted in this ?

Prabu on May 13th, 2012 6:49 pm

really great relationships between them. u made them very clear in a clear and perfect diagram no need to go through the paragraphs nice job joe :-)

santhosh reddy on May 23rd, 2012 7:58 pm


Email:

about
I am Joe, author of this blog. I run this with loads of passion. If you are into java, you may find lot of interesting things around ...more about me. Google+
java badge
Home