Compiler
A free lesson from Swipe Coding · Java, level 1 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
You now know that source code is human-readable, but the computer cannot execute it directly. This is exactly where the "compiler" comes in — a program that translates your source code.
The Java compiler is called "javac" (short for "Java Compiler"). It reads your .java file and translates it into a new file that the computer can process more easily. This process is called "compiling".
javac Main.java
The Java compiler is called ____.
Important: the compiler does not translate your code directly into machine language for a specific processor. Instead, it produces a special intermediate form called "bytecode" — more on that in the next lesson. This intermediate form is the trick that makes Java runnable on so many different devices.
The compiler also checks your code for errors. If, for example, you made a typo or forgot a bracket, the compiler stops with an error message and does not produce a translated file. This is called a "compile error".
What happens if your Java source code contains a typo?
You can think of the compiler like a translator converting a book from one language into another — except it also checks every sentence for grammar mistakes before translating it.
The Java compiler translates source code directly into machine language for a specific processor.
Keep your streak going in Swipe Coding
Swipe through every level of Java on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →