Card 03/ 06
All 6 cards
ExampleDifficulty: Beginner1 min
The Same Build Artefact on a Laptop and on a Linux Server
A colleague builds reports.jar on a Mac and puts it on a shared drive. You copy it to a Linux server that has never seen the source code, and run it.
$ uname -s
Linux
$ ls
reports.jar
$ java -jar reports.jar
Wrote 412 rows to reports/2026-09.csvThere is no compiler on that server and no .java file anywhere on it. A jar is a zip file full of .class files, and .class files hold bytecode — the same bytecode your colleague's machine produced, byte for byte.
What is different between the two machines is the Java Virtual Machine, the JVM. The Mac has one built for macOS on an ARM processor; the server has one built for Linux on x86. Each was written by someone else, for that machine, and each reads the same instruction set.
The two runs share more than they look like they do. In both, one translation had already happened before anything ran, and the second happened on the machine doing the running — which is why neither machine needed the source, and why neither needed to agree with the other about processors.