How Java Works?
The goal is to create an application (in other words, a simple program) that can function on various operating systems such as Linux, macOS, and Windows.
Sketch
![](https://www.javahandbook.com/content/images/2024/05/JVM_java-execution.png)
Steps
- Create a Java program or source document.
- The compiler runs the program, checks for errors, and only allows compilation if everything will run correctly.
- The compiler generates the output code or bytecode, which can be interpreted and run on any device capable of running Java. The compiled bytecode is platform-independent.
- The bytecode can be executed on any device with JVM installed, including electronic gadgets and supercomputers.