Thursday, September 28, 2006

Tip #3: Difference: Jvm, JRE, JDK, J2SDK, HotSpot...

JVM, JRE, JDK, J2SDK, HotSpot... : These terms are often parts of Java programmers communication. But, it seems.. all such terms sound to mean a same thing – no, they just seem, not really. Let’s discuss and distinguish the terms in detail.

JVM- Otherwise called as 'Java virtual machine' that actually takes the .class file as input, interprets it and executes it. JVM is platform dependent. The java.exe, found in your J2SDK/bin folder is called as JVM!

JRE - JRE includes a JVM and standard libraries (which are imported by default during execution). Note, JRE doesn't include other tools like jdb, javac, javap and etc. It includes only the jvm (java.exe) and default packages. JVM can be thought as a proper subset of JRE.

JDK - JDK is a box in which everything is put together. JDK includes JRE as well as other necessary tools and libraries. You have JRE, JVM and all the standard & extended libraries.

Important differences:

1. The important difference between JRE and JDK is that, Java License allows any one to re-distribute the JRE along with his product. But, it is illegal to re-distribute the JDK with your product!

2. JDK and J2SDK exactly refer to a same thing. But, what is difference? The term ‘JDK’ is just re-branded (re-named) to ‘J2SDK’ to bring a Standard (guts?) to Java. Seriously! :-)

The following simple formulas can help you to understand easily what were said above:

JVM = java.exe
JRE = JVM + Standard Libraries – Other java tools like jdb, javac.
JDK = JRE + Other java tools + all core libraries and packages.
J2SDK = rename (JDK)

Exercise:

The term ‘HotSpot’ is left unexplained. If you are curious to know, Pl, spare some minutes to find out yourself and post the answer as comment.
Or, let me post the answer in next tip.

4 comments:

prabs said...

mani why its called sdk ??

is sun development env?

Manivannan P said...

sdk - is a tool very specific for a particular platform. For instance, there can be a sdk for mobile application development. There can be a sdk for pda application development. It's not only for Sun development env, almost all companies doing such business have their own sdk.

Yoga said...

Hi mani,
I am so curious and find out the answer by simply googling.
HotSpot is an "ergonomic" JVM. Based upon the platform configuration, it will select a compiler, Java heap configuration, and garbage collector that produce good to excellent performance for most applications. Under special circumstances, however, specific tuning may be required to get the best possible performance. The resources collected here will help the reader understand and tune the Java HotSpot Virtual Machine.

Manivannan P said...

yoga, thanks for ur ans.. thats exactly right & gd explanation.