Archive

Posts Tagged ‘JRE and JVM’

What’s the difference between “JDK” and “JRE”?

January 12, 2010 Leave a comment

The “JDK” is the Java Development Kit.the JDK is bundle of software that you can use to develop Java based software. The “JRE” is the Java Runtime Environment.the JRE is an implementation of the Java Virtual Machine which actually executes Java programs.

Each JDK contains one (or more) JRE’s along with the various development tools like the Java source compilers, bundling and deployment tools, debuggers, development libraries, etc.

JRE is a subset of JDK.

  • Two steps for a java program ie.,compile and interpret.
  • JDK does compilation but JRE can’t.
  • Both JRE and JDK does interpretaion.

JVM :

The use of the JVM : – To convert the byte code into the machine specific code. So the JVM converts the byte code(ie the code which we get when we compile the .java class) into the code that your machine/OS understands. JVM is machine specific. So JVM for windows will be different from JVM for Mac or Unix. JVM is one of the most crucial part in the java engine. It is due to JVM only that we say java code is “Compile Once, Run Anywhere” programming language.

The byte code generated when we compile the code will be the same doesn’t matter we compiled the code in Windows OS or some other. However JVM makes sure that the byte code should be interpreted properly in the OS under concerned so interpret the byte code differently for different OS.