Java Virtual Machine is the engine that drives the Java code.
It is the medium which compiler compile the java code and generate the bytecode file which get interpret on different machine and hence it makes it Platform or operating system independent.
Bytecode is intermediary language between java source code and the host machine. JVM generate .class file that we can able to interpret and run in any OS, but it should have JVM within it, because JVM is System Independent.
Java is called platform independent because of JVM. As different computers with different OS have their own JVM, when we submit .class file to any OS, JVM interpret the bytecode into Machine level language.
JVM is the main component of Java architecture and it is the part of the JRE (Java Runtime Environment).
A program of JVM is written into C Programming Language and JVM is Operating System dependent. JVM is responsible to allocate and deallocate the necessary memory needed by the java program.
As we know that all programming language compilers convert the source code to machine code. Same job done by Java Compiler to run a Java program, but the difference is that Java compiler convert the source code into Intermediate code is called as bytecode. This machine is called the Java Virtual machine and it exits only inside the computer memory.
Following figure shows the process of compilation.
The Virtual machine code is not machine specific.
The machine specific code is generated by Java interpreter by acting as an intermediary between the virtual machine and real machines.
Java Object Framework act as the intermediary between the user programs and the virtual machine which in turn act as the intermediary between the operating system and the Java Object Framework.
The Virtual machine code is not machine specific.
The machine specific code is generated by Java interpreter by acting as an intermediary between the virtual machine and real machines.
Java Object Framework act as the intermediary between the user programs and the virtual machine which in turn act as the intermediary between the operating system and the Java Object Framework.
Just-In-time Compiler
JIT is the part of the Java Virtual Machine (JVM) that is used to speed up the execution time.
JIT interpret parts of the byte code that have similar functionality at the same time, and hence reduces the amount of time needed for full interpretation.
Java Runtime Environment
The JRE, also known as Java Runtime, is part of the Java Development Kit (JDK), a set of programming tools for developing Java applications.
The Java Runtime Environment provides the minimum requirements for executing a Java application.
It consists of the JVM, core classes, and supporting files.
Java Development Kit
The JDK is an implementation of either one of the Java SE, Java EE or Java ME.
Since the introduction of the Java platform, it has been by far the most widely used Software Development Kit (SDK).
On 17th Nov, 2006, Sun announced that it would be released under the GNU General Public License (GPL), thus making it free software.
Execution flow of Java program
Java Installation
Install Java SE which is freely available on Oracle’s website. Once you are done with installation of Java on your machine start practicing Java programs.
For writing a Java programs you can use any text editor, but for best practice use Notepad or Notepad++(Windows Machine).
Java code is case sensitive.