Card 06/ 06

RecapDifficulty: Intermediate1 min

What Turns Your Text Into Something That Runs

Four things this topic established, and where each one was.

What the topic established, and which card it was on
The thingWhere
Java translates twice: text to bytecode, then bytecode to processor instructionsWhy Your .java File Is Not a Program Yet
javac writes a .class file; java takes a class name and runs itOne Command Writes a File, the Other Reads It
The bytecode is identical everywhere; the JVM is what is built per machineThe Same Build Artefact on a Laptop and on a Linux Server
The JDK contains the JRE, which contains the JVM — install the JDK to compileJDK, JRE and JVM: Which One You Actually Install
The JVM looks for one exact main signature and reports nothing until you run itIt Compiled, and Then Said No Main Method Found

A failure's timing tells you which translation caught it. Compile-time means the text was not valid Java. Runtime means it was, and something about the world was not what the code assumed.