• JDK Architecture
  • Java Conceptual Diagram
  • JDK: Java Development Kit
The Java Development Kit (JDK) is a software development environment that offers a collection of tools and libraries necessary for developing Java applications.
The JDK contains a private Java Virtual Machine (JVM) and a few other resources such as an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) etc. to complete the development of a Java Application.
  • JRE: Java Runtime Environment
The Java Runtime Environment is a set of software tools which are used for developing Java applications. It is used to provide the runtime environment.
It is the implementation of JVM. It contains JVM, Java libraries, Native libraries and other supporting files.
  • JVM: Java Virtual Machine
Java Virtual Machine (JVM) is a engine that provides runtime environment to drive the Java Code or applications.
It is also responsible to manage all the resources required for Java Applications.
It converts Java bytecode into machines language. JVM is a part of Java Run Environment (JRE).
  • JDK vs JRE vs JVM
Java Virtual Machine (JVM) is a engine that provides runtime environment to drive the Java Code or applications.
JDK JRE JVM
Full form of JDK is Java Development Kit Full form of JRE is Java Runtime Environment Full form of JVM is Java Virtual Machine
JDK is platform dependent JRE is platform dependent JVM is platform independent
JDK is a software development kit JRE is a software bundle that allows Java program to run JVM is an environment for executing bytecode
JDK contains the installer JRE contains the environment to execute source code JVM contains both software JDK and JRE
JDK contains tools for developing, debugging, etc. JRE contains class libraries and other supporting files JVM conatins none of software development tools
  • Java Compiler
A compiler takes entire program(source code) and converts it into byte code(.class file) which is typically stored in a file. The byte code is also refereed as binary code and can be directly executed by the machine after linking.
Java Compiler is executable file with the name javac.exe will be available in JAVA_HOME\bin directory.
It is implemented in C/C++, so it is platform dependent.
  • Java Compiler
Java interpreter is a computer program (system software) that implements the JVM.
It converts the high-level program into assembly language (machine language).
It is designed in such a way that it can read the source program and translate the source code instruction by instruction.
Java Interpreter is executable file with the name java.exe will be available in JAVA_HOME\bin or JRE\bin directory.
We can run Java on the platforms that have a Java interpreter. It is the reason that makes the Java platform-independent.
  • Compiler vs Interpreter
Compiler Interpreter
Executable file is : javac.exe Executable file is : java.exe
Compiler scans the entire program and translates it as a whole into machine code. Interpreter translates program one statement at a time.
Compilers usually take a large amount of time to analyze the source code. Interpreters usually take less amount of time to analyze the source code.
The overall execution time is comparatively faster than interpreters. The overall execution time is comparatively slower than compilers.
Compiler displays all errors after compilation Interpreter displays errors of each line one by one
Compiler is based on translation linking-loading model Interpreter is based on Interpretation model
Generates intermediate byte code which further requires linking, hence requires more memory. No intermediate byte code is generated, hence are memory efficient.
Compiler compile the code after saving process done. Interpreter compile line by line
  • Byte Code
It is an intermediate code that will be generate using compiler after compiling the source file succesfully.
It will stored in a file with the extension .class
Java bytecode is the instruction set for the JVM.
Simply said, Bytecode is program code that has been compiled from source code into low-level code designed for a software interpreter.
  • Byte Code vs Machine code
Byte Code Machine code
Byte code is a non-runnable code generated by compiling a source code that relies on an interpreter to get executed. Machine code is a set of instructions in machine language or binary(1’s and 0’s) code which can be directly executed by the CPU.

Comments