The Java Virtual Machine, or JVM, is the program that actually runs Java software. The Java Virtual Machine Specification, published by Oracle, describes it as “the cornerstone of the Java platform” and “the component of the technology responsible for its hardware- and operating system-independence, the small size of its compiled code, and its ability to protect users from malicious programs.”
A key point in the specification is that the JVM is independent of the Java language itself. It states that “the Java Virtual Machine knows nothing of the Java programming language, only of a particular binary format, the class file format. A class file contains Java Virtual Machine instructions (or bytecodes) and a symbol table, as well as other ancillary information.” The JVM reads and executes those instructions, whatever source language produced them.
Because the machine is defined by the class file format rather than by Java syntax, any compiler that emits valid bytecode can target it. That is why the JVM today runs a whole family of languages besides Java, including Kotlin, Scala, and Clojure, all of which compile down to the same class files the JVM expects.
The specification also explains the portability the JVM provides: “programmers can write a program once, and it will run on any machine supplying a Java run-time environment.” By defining an abstract machine that does “not assume any particular implementation technology, host hardware, or host operating system,” the JVM let the same compiled program run unchanged across very different computers.