Java Interpreter- The Java Virtual Machine


.
The bytecode produced by a Java complire is interpreted by what is called a Java Interpreter which is an implementation of what Sun calls the Java Virtual Machine. For each different platform, you will need a different Java Virtual Machine or it will be built into your Java enabled Web Browser. This Java Virtual Machine provides the hardware specification to which all Java code is copmpiled and takes this code and transforms/interprets it into the appropriate machine-dependent code.

Steps of Interpreting code

  1. Loading Code : adds securing by separating the name spaces for the classes of the local file system and those imported from network sources. This limits any Tronjan-horse application because built-in classes are always checked first. When all classes have been loaded, memory layout of the executable is determined. Specific memory addresses are assigned to symbolic references and a LUT (look up table) is created. This run-time assignment of memory add protection agains illegal addressing of code.
  2. Bytecode Verifier: Tests the format of code fragments and applies a theorem prover to rule-check it for items like access violation of objects, attempts to change object type or class, forging of pointers.
  3. Executing code - thre runtime interpreter converts the loaded verified bytecodes to machine code and then executes this code.

How to Call the Java Interpreter

(See your JDK documentation for the most up to date instructions)
Suppose you have a Java application, with the main method belonging to the class called classname, then you type the following:

%  java  classname

© Lynne Grewe