“Java Virtual Machine (JVM) is a specification that provides runtime environment in which java bytecode can be executed. As the name implies, the JVM acts as a “virtual” machine or processor. Java’s platform independence consists mostly of its Java Virtual Machine (JVM). JVM makes this possible because it is aware of the specific instruction lengths and other particularities of the platform.” (net-informations.com,2017)
The JVM performs following operation. Such as,
- Loads code
- Verifies code
- Executes code
In most cases, for the other programming languages, the compiler produce code for a particular operating system but the Java compiler produce bytecode only for a Java Virtual Machine. When the user run a Java program, it runs as a thread within the JVM process. It is the JVM’s responsibility to load the class files, verify code, interpret them and execute them. When developer issue a command like java, the JVM loads the class definition for that particular class and calls the main method of that class.
Environmental flexibility in building the Java platform
Java language is platform independent. First of all, its source code gets compiled into a class file which is also known as Byte Code. Byte code contains machine instructions for the operating system. This generated byte code is same for all platforms id Windows, Linux, Mac etc. Byte code is evaluated and interpreted by Java Virtual Machine (JVM). JVM is platform dependent but it is available for all platforms. Thus, byte code instructions and JVM together makes Java platform independent.
Java for Mobile Applications (Java ME)
Java ME stands for Java Micro Edition. It enables us to develop applications for small devices like pages, set-top boxes, mobile phones etc. Java ME is specifically designed for battery operated devices with small memory and processing speed. Java ME provides a special JVM for micro devices which is known as KVM. It is a cut down version of standard JVM and optimized for working in very small amount of memory (256 KB)
Embedded Hardware Programming in Java
Java provides an extension of Micro Edition API which is suitable for embedded applications and known as Java ME Embedded. It enables users to develop highly secure, robust, scalable and functional applications for embedded devices like cameras, flight control systems and ATM machines.