7b - Java Virtual Machine
7b - Java Virtual Machine
The Java Virtual Machine (JVM) is a real name dropper when you’re programming in Java. Contrary
to what the name indicates, the Java Virtual Machine can be encountered in relation with other
programming languages as well.
In general, it’s not necessary to know what the Java Virtual Machine is, or even what it does, to be able
to program in Java. On the other hand, familiarizing yourself with the inner workings of a machine
does help to increase your understanding and overall insight.
This article brushes over the idea of the Java Virtual Machine, what it does for you, and some of the
most important pros and cons. Although I’ve tried to keep it simple, and there is definitely more
advanced literature on the subject, a rudimentary understanding of Java and programming is expected.
High-Level Languages
The semantics of a programming language are designed to be close to our natural language, while
staying concise and easy to interpret for a machine. As you probably know, the programming language
is wholly different from machine code, the set of instructions a computer uses to construct and run a
program. This we call high-level languages; one or multiple levels of abstraction from the machine
code.
Before it is able to run, high-level code must first be interpreted. A lot of programming interfaces
compile in advance (AOT compilation) for a specific platform (a specific operating system such as
Windows, or a specific brand and model of CPU chip). This makes the program more efficient at
runtime, but far less compatible with different platforms. Java, in contrast, works with an intermediate
language called Java bytecode and the Java Virtual Machine.
There's a more advanced description of what the JVM “contains” and how it interacts with the OS. If
you consider yourself an advanced computer user