3. JDK ( Java Development Kit )
Java Development Kit can be considered as
the super-set of JRE. JDK includes all features
that JRE has and over and above it contains
development tools such like compiler, debugger
etc. (Java Development Kit) is a Kit that provides
the environment to develop and
execute(run) the Java program.
JDK is a kit(or package) that includes two things
Development Tools(to provide an environment
to develop your java programs)
JRE (to execute your java program).
4. JRE ( Java Runtime Environment )
Java Runtime Environment (JRE) is within
which the java virtual machine actually
runs. JRE contains Java virtual Machine
and other files except development tools
(debugger and compiler). So developer
can run the source code in JRE but
he/she cannot develop and compile the
code.
5. JVM ( Java Virtual Machine )
JVM (Java Virtual Machine) is a very
important part of both JDK and JRE because
it is contained or inbuilt in both. Whatever
Java program you run using JRE or JDK
goes into JVM and JVM is responsible for
executing the java program line by line,
hence it is also known as an interpreter
8. JAVA VIRTUAL MACHINE(JVM)
JVM becomes an instance of JRE at the runtime of a Java
program. It is widely known as a runtime interpreter.JVM
largely helps in the abstraction of inner implementation
from the programmers who make use of libraries for their
programs from JDK.
It is mainly responsible for three activities.
1. Loading
2. Linking
3. Initialization
9. WORKING OF JVM
JVM(Java Virtual Machine) behaves as a run-time engine to run
Java applications. JVM calls the main method present in Java
code.
Java Virtual machine(JVM) is a part of the JRE(Java Runtime
Environment).
Java applications are WORA (Write Once Run Anywhere). This
means that we need to write the Java programs just once,
which we can run on different platforms without making
changes in the Java program.
When we compile a .java file, the compiler generates the
.class files(contains byte-code) with the same names as that of
the class present in a .java file.
When we run a .class file, it goes through various steps.
11. PROCEDURE
• After reading .class file, class loader save the corresponding
byte code in the method area. Generally all JVMs have only
one method area which is shared across classes which holds
information related to each .class file.
• Heap is an integral part of JVM memory in which the
objects actually rests. JVM produces the Class object for
each .class file.
• Unlike Heap, Stack is used for storing temporary variables.
• PC-Registers used to keep exact information of all
instructions (which instruction is executing and which is
going to be executed).
• A native method used to access the runtime data of the JVM
(java virtual machine). Native Method interface enables java
code to call by the native applications (programs that are
specific to the hardware and OS).