Java Compilation Process | WORA Architecture | What is JDK, JVM, JRE?

"what is jdk" "what is jdk in java" "what is jdk and jre" "what is java development kit" "what is jdk jre jvm" "what is java 1.8" "what is jvm jre and jdk" "what is jdk jre and jvm" "what is java se development kit" "what is jdk 1.8" "what is jvm jdk and jre"

Java Compilation Process, WORA Architecture, What is JDK, JVM, JRE?


📝What is Java CompilationJava Compilation is a 2 step process.

  • I. Check the Syntax of Java program. 
  • II. If the Program is Syntactically correct Byte code gets generated. 

📌Note: If a program is Syntactically wrong the compiler doesn’t generate Byte code but rather throws Error.
"what is jdk" "what is jdk in java" "what is jdk and jre" "what is java development kit" "what is jdk jre jvm" "what is java 1.8" "what is jvm jre and jdk" "what is jdk jre and jvm" "what is java se development kit" "what is jdk 1.8" "what is jvm jdk and jre"


📝WORA Architecture:  
"what is jdk" "what is jdk in java" "what is jdk and jre" "what is java development kit" "what is jdk jre jvm" "what is java 1.8" "what is jvm jre and jdk" "what is jdk jre and jvm" "what is java se development kit" "what is jdk 1.8" "what is jvm jdk and jre"


  • Java program and Java Application can run on any different platform, Provided the platform must have JVM. After successful compilation, the Byte code is generated. 
  • Java applications are called WORA (Write Once Run Anywhere). This means a programmer can develop Java code on one system and can expect it to run on any other Java-enabled system without any adjustment. This is all possible because of JVM. 
  • In traditional programming languages like C, C++ when programs were compiled, they used to be converted into the code understood by the particular underlying hardware, so If we try to run the same code at another machine with different hardware, which understands different code will cause an error, so you have to re-compile the code to be understood by the new hardware. 
  • In Java, the program is not converted to code directly understood by Hardware, rather it is converted to bytecode(.class file), which is interpreted by JVM, so once compiled it generates bytecode file, which can be run anywhere (any machine) which has JVM( Java Virtual Machine) and hence it gets the nature of Write Once and Run Anywhere. 


What is JVM? :

  • JVM (Java Virtual Machine) is an abstract machine. It is called a virtual machine because it doesn't physically exist. It is a specification that provides a runtime environment in which Java bytecode can be executed. It can also run those programs which are written in other languages and compiled to Java bytecode. 
  • JVMs are available for many hardware and software platforms. JVM, JRE, and JDK are platform dependent because the configuration of each OS is different from each other. However, Java is platform-independent. There are three notions of the JVM: specification, implementation, and instance. 

🌟The JVM performs the following main tasks: 

  • Loads code
  • Verifies code 
  • Executes code
  •  Provides runtime environment 
What is JRE? :

  • JRE is an acronym for Java Runtime Environment. It is also written as Java RTE. The Java Runtime Environment is a set of software tools that are used for developing Java applications. It is used to provide a runtime environment. It is the implementation of JVM. It physically exists. It contains a set of libraries + other files that JVM uses at runtime. 
  • The implementation of JVM is also actively released by other companies besides Sun MicroSystems
What is JDK? :

  • JDK is an acronym for Java Development Kit. The Java Development Kit (JDK) is a software development environment that is used to develop Java applications and applets. It physically exists. It contains JRE + development tools. 

🌟JDK is an implementation of any one of the below given Java Platforms released by Oracle Corporation: 

  • Standard Edition Java Platform 
  • Enterprise Edition Java Platform 
  • Micro Edition Java Platform 


🌟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.

🌟Difference between JDK, JRE, and JVM:
Here are some major differences between JDK vs. JRE vs. JVM:
JDKJREJVM
  • The full form of JDK is the Java Development Kit.
  • The full form of JRE is Java Runtime Environment.
  • The full form of JVM is Java Virtual Machine.
  • JDK is a software development kit to develop applications in Java.
  • It is a software bundle that provides Java class libraries with necessary components to run Java code.
  • JVM executes Java byte code and provides an environment for executing it.
  • JDK is platform dependent.
  • JRE is also platform dependent.
  • JVM is platform-independent.
  • It contains tools for developing, debugging, and monitoring java code.
  • It contains class libraries and other supporting files that JVM requires to execute the program.
  • Software development tools are not included in JVM.
  • It is the superset of JRE
  • It is the subset of JDK.
  • JVM is a subset of JRE.
  • The JDK enables developers to create Java programs that can be executed and run by the JRE and JVM.
  • The JRE is part of Java that creates the JVM.
  • It is the Java platform component that executes source code.
  • JDK comes with the installer.
  • JRE only contains the environment to execute source code.
  • JVM bundled in both software JDK and JRE.
📢Next Topic: