What is the JVM? Java Virtual Machine Explained

The JVM runs Java bytecode on any operating system. It is why Minecraft Java Edition and every Fabric mod run the same on Windows, macOS, and Linux.

Conceptsby trqUpdated June 4, 2026
Key takeaways
  • The JVM (Java Virtual Machine) is the program that runs compiled Java bytecode.
  • Same bytecode runs on Windows, macOS, and Linux, so mods do not need recompiling.
  • Players need a Java runtime (JRE); modders need the full JDK with the compiler.
  • Minecraft Java Edition and every Fabric mod, including Opal, run on the JVM.

The JVM, or Java Virtual Machine, is the program that runs Java code. You write Java, a compiler turns it into bytecode, and the JVM runs that bytecode on any operating system. This is why Minecraft Java Edition and the mods built for it behave the same on Windows, macOS, and Linux without recompiling.

Where Opal fits

Opal is a Fabric mod, so it runs on the same JVM as the game. If you are setting it up, the setup guide walks through it.

What the JVM actually does

The JVM runs bytecode, not source code. When you compile a Java program you do not get a Windows or Mac executable. You get class files full of bytecode, a compact instruction set the JVM understands. The JVM reads those instructions and executes them on your machine.

That extra layer is the point. The same bytecode runs anywhere a JVM exists, so "write once, run anywhere" is the short version of why Java spread so widely. The JVM is the part that makes the promise true.

JVM, JRE, and JDK

These three terms get mixed up a lot, so here is the split.

TermWhat it isWhen you need it
JVMThe engine that runs bytecodeAlways, to run any Java program
JREThe JVM plus the standard librariesTo run Java programs
JDKThe JRE plus the compiler and dev toolsTo build Java programs

A player only needs a runtime to launch the game. A developer building a mod needs the full JDK so they can compile Java into bytecode in the first place.

How the JVM runs your code fast

The JVM starts by interpreting bytecode one instruction at a time. As it runs, it watches which methods get called the most. Those hot paths get handed to the JIT compiler, which turns them into native machine code on the fly. After warm-up, the busiest code runs at close to native speed.

The JVM also manages memory for you. A garbage collector reclaims objects you stop using, so you do not free memory by hand the way you would in C. This is one reason Java is forgiving to write and a common first language for modders.

Why it matters for Minecraft

Minecraft Java Edition runs on the JVM, and so does every utility client and mod that targets it. A client's own code can be Java, Kotlin, or another JVM language, because they all compile to the same bytecode the JVM runs. A Fabric mod ships as a jar of bytecode, the loader wires it into the game at launch, and the JVM runs the whole thing as one process.

This is also why launchers let you tune things like the heap size and which Java version to use. You are configuring the JVM that hosts the game, not the game itself.

FAQ