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.
Verify:
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:
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
★ Exercises
- Install JDK 25 and print
java --version. - Write
Profile.javaprinting three lines about yourself. - Compile it with
javac. What file appears, and how big is it? - Remove a semicolon on purpose and read the compiler error: file, line, column.