Part 01 / Topic 1 of 9
What Kotlin is, and the four pieces that run it
Kotlin is a statically-typed, concise language that compiles to the same bytecode the Java
Virtual Machine already runs. "Statically-typed" means every value's type is fixed and checked
before the program runs (same idea as Java, different syntax). "Concise" means Kotlin trims a lot
of the ceremony Java needs for the same program — you'll feel this from Part 2 onward, once val/var
and string templates are on the table.
Real-world example: backend APIs built with Ktor or Spring Boot, most new Android apps (Google
made Kotlin its preferred Android language in 2019), and Gradle's own build scripts (build.gradle.kts)
are all Kotlin. Stage 1–4 of this course stay on the plain JVM target; Android and Ktor are Stage 5
specializations, not something this part needs.
Unlike Java, Kotlin has no runtime of its own — there's no "KVM." It rides entirely on the JVM, plus one extra library of its own:
| Piece | What it is | Do you need it installed? |
|---|---|---|
| JDK 21 LTS | Compiles and runs JVM bytecode; both kotlinc and the programs it produces need a JDK underneath them |
Yes — the Homebrew kotlin formula installs one for you as a dependency |
kotlinc |
The Kotlin compiler: turns .kt source into .class files (JVM bytecode) |
Yes — this is "the Kotlin tool" you install |
kotlin |
The Kotlin launcher: runs a compiled class, a .jar, a script, or a one-line expression — and quietly adds kotlin-stdlib.jar to the classpath when it does |
Installed alongside kotlinc by the same formula |
kotlin-stdlib.jar |
Kotlin's standard library: collection helpers, string helpers and more that go beyond what the bare JDK provides | Needed on the classpath the moment your code uses more than plain JDK calls — section 8 shows exactly when |
🔍 Going deeper: Kotlin also targets Android (via its own bytecode step, not
kotlinc), Kotlin/Native and Kotlin/JS. None of that changes how Stage 1–4 work: every example here is plain Kotlin on the JVM, the same targetkotlincuses by default.
Done here? The practice set for Part 1 — including the solutions — is on the part page.