Java Lesson 1: Install the JDK and Run Hello World

Java Lesson 1: Install the JDK and Run Hello World featured illustration

πŸ“Ž This article includes 1 downloadable practice file ↓

⏱ 1 min read

πŸ“˜ Java Beginner Course Β· Lesson 1 of 8

Advertisement
  1. Install a JDK 21 (LTS), e.g. Eclipse Temurin from adoptium.net.
  2. Check: java -version in a terminal.
  3. Save Hello.java and run java Hello.java (Java 11+ runs a single file directly).
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello from Java!");
    }
}

Every Java program starts in a main method inside a class. The file name must match the public class name.

πŸ’‘ IntelliJ IDEA Community (free) or VS Code with the Java extension pack gives autocomplete and one-click run, a big help while learning.

Code for this course follows standard, current syntax; we test JavaScript and PowerShell scripts before publishing, and R/Java/Rust examples are kept to core language features. Tell us if anything fails on your setup.

Practice

Install the JDK and run Hello.java.

Advertisement

πŸ“Ž Practice files for this article

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong