OpenJDK Terminology

Bytecode

July 03, 2026

When you compile a Java source file, the Java compiler (javac) does not produce native machine code for a specific CPU. Instead it produces bytecode: a compact, platform-neutral instruction set stored in .class files. Bytecode is not directly understood by the operating system; it is executed by the Java Virtual Machine (JVM), which translates it into native instructions at runtime.

This two-step model — compile once to bytecode, run anywhere on a JVM — is the foundation of Java's "write once, run anywhere" promise. The same .class file runs without modification on Windows, Linux, or macOS, as long as a compatible JVM is available.

Bytecode is also the reason the JVM can host languages other than Java. Kotlin, Scala, Groovy, and Clojure all compile to the same bytecode format, allowing them to interoperate seamlessly with Java libraries.

Comments (0)

Your email address will not be published. Required fields are marked *

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

Save my name, email, and website in this browser for the next time I comment.

Comments (0)

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

No comments yet. Be the first.

Subscribe to foojay updates:

https://foojay.io/feed/
Copied to the clipboard