The Java Virtual Machine

The core of Java, which makes it able to do its magic, is the Java Virtual machine, or JVM. I'm not going to cover the JVM in its entirety. There's a specification available at the JavaSoft Web site for anyone interested in all the details. Instead, I will just explain what the JVM does, and why it's so important to Java. The JVM runs as a process, started with the java command.

The JVM may be thought of as a mini-operating system and a CPU all in one. It provides many of the same features as an OS, such as memory management, task management, thread scheduling (in cooperation with the native OS), and so on. It has its own set of registers, a stack, a heap, and a global String buffer.

When you run a Java program, it runs ...

Get PURE Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.