Card 06/ 06

RecapDifficulty: Intermediate1 min

Recap: How Java Runs

Two translations, two commands, one portable jar, three nested installs and one entry point.

How Java runs comes down to the five ideas below, each listed with the card that covers it.

What the topic established, and which card it was on
The ideaWhere
Java translates twice: text to bytecode, then bytecode to processor instructionsHow Java Runs: Source Code, Bytecode and the JVM
javac writes a .class file; java takes a class name and runs itjavac and java: Compiling and Running a Class
The bytecode is identical everywhere; the JVM is what is built per machineJava Portability Example: One Jar on a Mac and on a Linux Server
The JDK contains the JRE, which contains the JVM; install the JDK to compileJDK vs JRE vs JVM
The launcher looks for one exact main signature, and says nothing until you run itThe main Method Signature the Launcher Looks For

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.