Java architecture Basics

Java comprises of the following basic parts:

  • Java programming language: Code in Java is compiled to Bytecode format .class file.
  • Java APIs: A set of Java .class files, which provide pre-coded functions.
  • Java Virtual Machine (JVM): Code that runs the Bytecode in a particular Operating System.. Bytecode .class file is converted to machine language by JVM and then run in the local Operating System.

JVM is made up of 2 basic parts

  • Class loader: Loads the .class file into RAM after converting into Operating System dependent data structures
  • Execution Engine: Takes the data structures and converts to Machine Language for the OS and then runs it in the OS.

For each hardware architecture, a different Java Bytecode Interpreter is needed. Since it is an interpreter, execution is slower than program compiled to native Machine language.This is mitigated by Just-in-time compilers (JIT) which compile to Machine Code before executing.

Java Runtime Environment (JRE): Contain all that is needed to run a Java program. Is a combination of JVM and Java APIs.

Java Developmen Kit (JDK): Comprises a package of all the software needed to compile, document an execute Java programs. Consists of

  • Java programming language
  • JRE
  • Tools and Tool APIs – java, javac, apt, jar, javap etc.
capture

References:

Leave a comment