Internals of Compiler and JVM

Internals of Compiler and JVM

We will start with differences between JDK, JRE and JVM and then internals of Compiler and JVM

Hello guys, I am back with a new blog and in this blog, we are going to talk about some important aspects of Java such as

  • Difference between JDK, JRE, and JVM
  • The Java Compiler
  • Internals of JVM

Let us first start with the differences between JDK, JRE, and JVM.

  • *JDK — *JDK stands for Java Development Kit. It provides a software development environment for developing Java applications. It includes the Java Runtime Environment (JRE), an interpreter (java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc), and other tools required for the development of applications.
  • JRE — JRE stands for Java Runtime Environment. JRE is core libraries plus Java virtual machine. It provides an environment to execute a java application.
  • JVM — JVM stands for Java Virtual Machine. Whenever you execute a program via the java command, it creates a virtual environment in which the program is loaded along with core libraries.

Compilation

The Java Compiler compiles the source files (*.java) into class files. Each class file contains machine-independent byte code, and once compiled, it can be executed on any machine. Therefore class files are platform-independent whereas JVM is platform dependent. The reason behind this is JVM makes use of the internals of the Operating System. That is why we have different setups for different operating systems. The JVM transforms the byte code into machine code or native code.

The compilation of source files involves the following steps

  • *Parse — *Reads source files and then maps the resulting token sequence into the Abstract Syntax Tree. The Abstract Syntax Tree is a tree representation of the abstract syntactic structure of source code. Each node in a tree denotes a construct occurring in the source code. The syntax is “abstract” in the sense that it does not represent every detail appearing in the real syntax, but rather just the structural or content related details

    Image for post

  • *Enter — *Enter symbols for the definitions into the symbol table. The Symbol table stores information about various entities such as variable names, function names, objects, classes, interfaces, etc. A symbol table may serve the following purposes

compilers jvm architecture java

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

Learning by Doing: How to Learn Java Basics by Building Your Own Project

Check out some ideas for sample projects that can help you learn Java, and programming in general, in a fun and engaging way.

How to Install Multiple Versions of Java on the Same Machine

In this post, we look at a common problem facing Java developers: how to install multiple versions of the JDK on the same machine. Let's find out.

“The Evolution” — Java JIT Hotspot and C2 Compilers

This blog is the first in the series, where we will explore Java JIT, HotSpot, Graal, Truffle, Quarkus, and how to build the most optimum Java MicroServices.

Java Core (2020) | Java for beginners | Brush up your Java Skills | Get Hired

In this video we will learn about all the major concepts that come under Java Core . The course is very carefully designed and is made with keeping simplicit...