Java Components - Java Virtual Machine, Java Runtime Environment, Java Development Kit
1. JVM - Java Virtual Machine
As the name suggested it is a virtual machine installed on a Computer System. JVM works as our real machine (Operating System) JVM provides the functionality of garbage collection, memory management, class-loader, java compiler, security, etc. The platform-independence of JVM allows us to create Java programs on one machine and execute them on another machine (WORA – Write – Once – Run – Anywhere).
The JVM is present in the RAM. The Java program is converted to a class file by the Java compiler(javac). When we execute the .class file (using ‘java classFilename’ in cmd), the .class file is brought into the Ram by the ClassLoader. After that Byte Code (.class file) is verified by JVM for any security issues.
The JVM has JIT(Just In Time Compiler) OR Interpreter that converts Byte-Code to Machine Language.
2. JRE - Java Runtime Environment
JRE is a software layer that provides Libraries & Recourses to run a java Program or Application. JRE contains tools that help developers to improve their User Interface. The JDK and JRE interact with one another to create a sustainable runtime environment that enables the seamless execution of Javabased applications in virtually any operating system.
What does JRE consist of:-
User interface tools – It contains libraries like AWT and Swing etc. In java, these libraries are used to design the user interface of a software
Class-Loader – Class-Loader is responsible for loading .class files into ram because JVM exists in ram to run this .class file
Class-Loader – Class-Loader is responsible for loading .class files into ram because JVM exists in ram to run this .class file
Byte-Code Verifier – After Class-Loader bring .class file into memory (Ram) then this .class file is verified by the byte-code verifier to ensure that this file is not corrupted and properly formatted.
Byte-Code Verifier – After Class-Loader bring .class file into memory (Ram) then this .class file is verified by the byte-code verifier to ensure that this file is not corrupted and properly formatted.
JIT (Just In Time Compiler) – After verifying byte-code now it is time to convert this byte code (Understood by JVM) to machine Language. Just in time compiler does this conversion.
3. JDK - Java Development Kit
JDK is a core component of java. As we already discussed that The JDK and JRE interact with one another to create a sustainable runtime environment that enables the seamless execution of Java-based applications in virtually any operating syste
Basically, JRE is responsible for run the java application or program into that environment and JDK is responsible to develop these applications and programs because JDK contains a java compiler, java debugger, and built-in libraries of java.
As we know java has huge built-in libraries. Typically, if you are only interested in running Java programs on your machine or browser, you only need to install JRE. However, if you would like to develop an application and do Java programming, you will need JDK.
or example, a student has a school kit consist of books, notebooks, pens, etc.
If you have any Questions or Queries
You can mail us at mohsinrahman318@gmail.com
0 Comments