Java Compilation and Bytecode
`javac` compiles `.java` source into platform-independent `.class` bytecode that the JVM runs.
Easy
javac Main.java && java Main
java Main.java # single-file run (Java 11+)
javap -c Main # view bytecode
"Write once, run anywhere" — the same bytecode runs on any OS with a JVM.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.