Card 06/ 06
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.
| The idea | Where |
|---|---|
| Java translates twice: text to bytecode, then bytecode to processor instructions | How Java Runs: Source Code, Bytecode and the JVM |
javac writes a .class file; java takes a class name and runs it | javac and java: Compiling and Running a Class |
| The bytecode is identical everywhere; the JVM is what is built per machine | Java 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 compile | JDK vs JRE vs JVM |
The launcher looks for one exact main signature, and says nothing until you run it | The 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.
← → move through sections and cards