Course Content
Java Extended
Java Extended
How does the compiler works?
How Does it Actually Work?
Java is a language with a complex internal structure. Let's delve into the internals of Java and briefly understand how everything is organized.
JVM
JVM is responsible for translating Java bytecode, which is platform-independent, into machine-specific instructions that can be understood by the underlying operating system. It provides a layer of abstraction between the Java program and the hardware, allowing Java programs to run on different platforms without the need for recompilation. In simple terms, JVM is like a virtual computer that enables the execution of Java programs on different systems.
ByteCode
The most important thing to understand now is that this is how Java achieves its famous cross-platform compatibility and flexibility.
JRE
It includes the Java Virtual Machine (JVM), which is responsible for executing the bytecode of Java programs, and a set of core libraries and runtime components. The JRE allows you to run Java applications on your computer without needing to compile the source code.
In simple terms, it's the environment that enables you to run Java programs on your system.
JDK
It includes the Java compiler, which translates human-readable Java source code into bytecode that can be executed by the Java Virtual Machine (JVM). The JDK also includes various libraries, development tools, and documentation that assist in the creation, testing, and debugging of Java programs.
In simple terms, it's a package that allows you to write, compile, and build Java applications.
Libraries
We will later explore what they are and how to import them into our code. For now, it's important to remember that they are located in the JRE (Java Runtime Environment).
Compiler
Debugger
Overall
I understand that this may seem difficult to grasp, but this information is important for understanding how the programming language perceives everything from its perspective.
This is also the main reason why the compiler takes so long to work. Due to all this structure, sometimes the code can take 10-15 seconds to compile.
Thanks for your feedback!