Setup: JDK 25 & Editor

Install the JDK

You need the JDK (compiler + tools), not just a JRE. Pick any OpenJDK build: Eclipse Temurin, Amazon Corretto or Oracle OpenJDK.

# macOS
brew install --cask temurin@25

# Linux
sudo apt install openjdk-25-jdk

# Windows
winget install EclipseAdoptium.Temurin.25.JDK

# any platform, several versions side by side
sdk install java 25-tem      # sdkman.io

Verify:

java --version     # openjdk 25 …
javac --version
No javac?

You installed a JRE, or the JDK’s bin folder is not on your PATH.

Editor

  • VS Code — install Extension Pack for Java
  • IntelliJ IDEA Community — set Project SDK and language level to 25

Your first program

Hello.java:

void main() {
    IO.println("Hello, Java 25!");
}
java Hello.java      # runs directly, no compile step
New in Java 25

Compact source files and instance main methods (JEP 512) drop the class shell, static, and String[] args. The always-available java.lang.IO class provides println, print and readln. The classic form still works — see chapter 7.

Compiling by hand

javac Hello.java     # produces Hello.class
java Hello           # no file extension!

★ Exercises

  1. Install JDK 25 and print java --version.
  2. Write Profile.java printing three lines about yourself.
  3. Compile it with javac. What file appears, and how big is it?
  4. Remove a semicolon on purpose and read the compiler error: file, line, column.