Wednesday, 23 May 2018

What is jdk,jre and jvm in java(difference between them)

1)jdk:

Java development kit is Kit which provides the environment to develop and execute(run) the java program.

JDK include two things :

  1. Development Tools to provide an environment to develop your java program 
  2. JRE to execute your java program 
  • JDK=JRE(JVM + Libraries) +Developer Tools //jdk is the combination of jre and Development tools
  •  jdk Development tools like Compiler,debugger etc.
  • jdk is a 3 step process
  1. Write java code 
  2. Compile java code
  3. Execute java code

NOTE:JDK IS ONLY USED FOR JAVA DEVELOPERS.


2) JRE

Java Runtime Environment :is an installation package which provides environment to only run(not develop) the java program onto your machine.JRE is only used by them who only wants to run the java programs. 

WHAT IS THE MINING OF THESE SENTENCE LET'S UNDERSTAND:

Ex:you run the software which is develop with the help of java ide you only run the software(execute) not edit the source code and not change in any feature you have only JRE to run and execute the software.

  • JRE contains sets of libraries and JVM use tose libraries at Runtime.
  • JRE=JRE(JVM+LIBRARIES) it means JRE is a combination of JVM AND LIBRARIES
  • To run any code JRE is minimum required
3) JVM

JAVA VIRTUAL MACHINE :is an abstract machine.It is a specification that provides runtime environment in which java bytecode can be executed.

JVM are available for many hardware and platforms(i.e. JVM is platform dependent)

  • whenever you write java command on the command prompt to run the java class, the java class,an instance of JVM is created.

  1. THE JVM PERFORMS FOLLOWING OPERATION:

  • Load code 
  • Verifies code 
  • Executes code 
  • provides runtime environment
  1. JVM PROVIDES DEFINITIONS FOR THE:
  • Memory area 
  • Class file format 
  • Register set 
  • Garbage collected heap
  • Fatal error reporting etc


No comments:

Post a Comment