Command Palette

Search for a command to run...

Phase 0Beginner1 of 17 in Core Java

Start Here: Programming and Java from Zero

What a program is, what Java, the JDK and the JVM are, which Java version to use, how to run your first program, and what really happens when it runs.

This phase assumes you have never written a line of code. We start with what a program is (a list of exact instructions), why computers need programming languages, and how Java turns the text you type into something a computer can run. Every new word is explained before it is used.

Then you get your hands dirty: install a JDK, compile and run your first program, read every part of it, play with Java line by line in JShell, and learn to read the error messages that every programmer sees many times a day. Errors are not failures. They are the computer telling you exactly where to look.

The last topic goes all the way down: how javac produces bytecode, how the JVM loads classes, verifies them, interprets them and then compiles hot code to machine code with its JIT compilers. Beginners get the picture, and experienced engineers get the details that come up in interviews and performance work.

0/8 · 0%
8 topics ~4 h 33 code blocks & diagrams
Start with the first topic
1
0.1

What a Program Is

A program is a list of exact instructions that a computer follows one after another, very fast and without ever guessing what you meant. A programming language like Java lets humans write those instructions in words, and a tool translates them into the numbers the computer's chip understands.

29 min 3 code practice

2
0.2

What Java Is: JDK, JRE, JVM and Bytecode

Java is a programming language plus a platform to run it. The javac compiler turns your .java files into portable bytecode (.class files), and a Java Virtual Machine on each computer runs that same bytecode, which is why one compiled program works on Windows, macOS and Linux. The JDK is the toolbox for writing Java; the JVM is the engine that runs it.

30 min 4 code practice

3
0.3

Java Versions, LTS Releases and the Version Tags in This Course

A new Java version comes out every March and September, and every two years one of them is a Long-Term Support (LTS) release that companies stay on for years: Java 8, 11, 17, 21 and 25. This course tags each feature with the version that introduced it (such as Java 16), and the in-browser Run button uses Java 17.

33 min 4 code practice

4
0.4

Install the JDK and Run Your First Program

Install a free JDK (Eclipse Temurin), check it with java -version and javac -version, then write Main.java, compile it with javac Main.java and run it with java Main. Since Java 11 you can also skip the separate compile step and run java Main.java directly.

28 min 4 code practice

5
0.5

Anatomy of a Java Program

Every Java program lives inside a class, starts running at the main method, and is made of statements that end with semicolons, grouped into blocks with curly braces. This topic explains every word of public static void main(String[] args) and of System.out.println, plus comments, names and the rules the compiler enforces.

28 min 5 code practice

6
0.6

Try Java Instantly with JShell

JShell is Java's interactive playground, included in every JDK since Java 9. You type one line of Java, press Enter, and see the result at once, with no class, no main method and no compile step, which makes it the fastest way to test an idea or explore a library method.

27 min 4 code practice

7
0.7

Reading Compiler Errors and Stack Traces

Java reports problems in two places: the compiler (javac) rejects code that breaks the rules, giving the file, line, a message and a caret ^ under the spot; and the JVM reports problems while running as an exception with a stack trace, a list of the method calls that led to the crash. Reading both calmly, top line first, is the most useful debugging skill you can learn.

32 min 4 code practice

8
0.8

How Your Code Really Runs: Compile, Load, Interpret, JIT

javac turns source into bytecode; the java launcher starts a JVM that loads classes only when first needed, verifies and links them, runs their static initialisation, then interprets the bytecode while counting what runs most. Hot methods are compiled to optimised machine code by the JIT compilers (C1, then C2), and the JVM can throw that code away and fall back if its guesses turn out wrong.

33 min 5 code practice