Setting Up Your Java Development Environment
Java & Spring Boot for Beginners · Part 2 of 14
- #Java
- #Spring Boot
- #Beginners
- #Tooling
In Part 1 I made the case for learning Java and Spring Boot in 2026. This part is the unglamorous but necessary next step: getting a development environment on your machine that works and then mostly stays out of your way.
I've onboarded enough engineers to know that setup is where a surprising number
of people quietly give up. Not because it's hard — because they hit a fork in
the road (which JDK? which version? which installer?) with no way to tell which
choice matters and which one they can flip a coin on. I once spent a morning
helping a new hire who had four JDKs installed, three of them from following
different blog posts, and none of them the one his PATH was actually pointing
at. That's the failure mode this post is trying to prevent.
So here's the opinionated version. I'll tell you exactly what to install, and I'll flag the two or three decisions that are actually worth a second thought. Budget about fifteen minutes.
What you're actually installing
Three things, in order:
- A JDK — the Java Development Kit. This is the compiler, the runtime (the JVM), and the standard library. It's the only thing you strictly need to compile and run Java.
- An IDE — IntelliJ IDEA. Technically optional; in practice, nobody writes Java in a plain text editor, and the IDE does enough for you that skipping it just makes learning harder.
- A version manager — optional but recommended. It makes installing and switching JDKs a one-line command instead of a download-and-configure ritual.
Let's take them one at a time.
Choosing a JDK: distribution and version
Here's the thing that trips people up first: "the JDK" isn't one download. Java is a specification, and several organizations build and ship their own JDK from the same OpenJDK source. For everything you'll do in this series they are interchangeable — the differences are support contracts, how fast security patches land, and a handful of extras you won't touch as a beginner.
Distribution: use Amazon Corretto. It's Amazon's build of OpenJDK — free, no account or licence acceptance, long-term security updates, and it's what runs under most AWS services, so what you learn on lines up with where a lot of Java ends up deployed. Eclipse Temurin (the Eclipse Adoptium build) and Azul Zulu are equally solid choices and you'll see Temurin most often in tutorials and Docker images — if you're already using it, there's no reason to switch. I'd avoid the Oracle JDK as a beginner purely because its licence terms have changed twice in recent memory and you don't need that question in your head right now.
Version: use the current LTS, which is Java 25. Java ships a release every six months, but every fourth one is a Long-Term-Support release that gets years of updates. As of 2026 that's Java 25. Learning on the LTS means the tutorials, Stack Overflow answers, and library docs you'll read all line up with what's on your machine. Java 21 (the previous LTS) is also completely fine if something in your ecosystem isn't on 25 yet. Newer non-LTS releases like Java 27 are worth reading about, but not worth learning on.
One rule: don't learn on Java 8 or 11, even though plenty of production systems still run them. The language has changed enough since then that you'd be learning around missing features.
Installing it: version manager vs. installer
You have two honest options here.
Option A: SDKMAN (macOS / Linux / WSL) — my recommendation
SDKMAN manages JDKs (and Maven, Gradle, and other JVM tools) for you. Install it once:
curl -s "https://get.sdkman.io" | bash
Open a new terminal, then:
sdk install java 25-amzn # 25 = version, amzn = Amazon Corretto
sdk use java 25-amzn # this shell
sdk default java 25-amzn # every new shell
sdk list java shows everything available, with the exact identifier for each
build (25.0.1-amzn and so on) if the short form doesn't resolve. When Part 6
needs a specific Maven
version, it's sdk install maven and you're done. The reason I push people
toward this: six months from now you will need a second JDK for some project,
and with SDKMAN that's one command instead of an afternoon.
On Windows, use SDKMAN inside WSL (the Windows Subsystem for Linux), which is
also where I'd suggest doing the rest of this series. If you want to stay on
native Windows, Scoop with its java bucket
(scoop install java/amazon-corretto-jdk) fills the same role.
Option B: the platform installer
Go to aws.amazon.com/corretto, download the
Corretto 25 installer for your OS, and run it. On macOS it's a .pkg; on
Windows a .msi that can set JAVA_HOME and the PATH for you if you tick the
box during setup. This is fine. It's just more manual the day you need a second
version.
Verify
Whichever route you took, open a fresh terminal:
java -version
You want to see something like openjdk version "25" and a Corretto build
string. If the command isn't found, your PATH didn't pick up the JDK — restart
the terminal, and on the installer route, check that JAVA_HOME points at the
JDK folder.
Installing IntelliJ IDEA
Download IntelliJ IDEA Community Edition from jetbrains.com/idea. Community is free and open-source, and it does everything you need for this series — plain Java, Maven, Gradle, JUnit, a debugger. The paid Ultimate edition adds Spring-specific tooling and a database client; nice later, not needed now. (If you're a student, JetBrains gives Ultimate away for free with an academic email — worth doing, but don't block on it.)
Install it, launch it, and let it use the JDK you just installed — IntelliJ is
usually good at detecting it. If it asks and can't find one, point it at the
JDK directory (~/.sdkman/candidates/java/current on SDKMAN, or
/Library/Java/JavaVirtualMachines/... on the macOS installer).
Skip the plugin marketplace tour for now. The defaults are good.
Your first program, two ways
Let's write Hello, World and run it from both the IDE and the terminal,
because you'll use both constantly and it's worth seeing that they're doing the
same thing.
From IntelliJ
New Project → name it hello, choose Java, build system IntelliJ
(not Maven or Gradle yet — that's Part 6), and pick your JDK. IntelliJ creates a
src folder. Right-click src → New → Java Class, name it Hello, and
write:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello from IntelliJ");
}
}
Click the green ▶ in the gutter next to main. The Run panel opens at the
bottom and prints the line. That green arrow is the single most-used control in
the IDE.
From the terminal
Since Java 11 you can run a single source file directly, no separate compile step:
java Hello.java
That's genuinely all it takes for one file. Under the hood it compiles in memory
and runs main. For anything bigger than one file you'll compile explicitly:
javac Hello.java # produces Hello.class (bytecode)
java Hello # runs it — note: no .java, no .class
The IDE's green arrow runs exactly this javac-then-java sequence for you,
against the same JDK. I bring this up because a lot of beginners treat the IDE as
a black box and get stranded the first time they have to run something on a
server with no IntelliJ on it. It's a very good wrapper around two commands —
that's all.
What to skip for now
To keep the setup honest, here's what you don't need yet, so you can wave it away when a tutorial brings it up:
- Maven or Gradle — Part 6. For now, single files and IntelliJ projects are enough.
- Multiple JDK versions — one current LTS is fine until a real project forces the issue.
CLASSPATHas an environment variable — a source of ancient pain that modern tooling handles. Don't set it.- Fancy IntelliJ plugins, themes, keymaps — customise later, once you know what annoys you.
Where this leaves you
You now have a current LTS JDK, a way to install more without pain, IntelliJ IDEA Community, and a program you've run from both the IDE and the shell. That's the whole foundation — everything in the rest of the series builds on exactly this.
Next up: Part 3 — Java fundamentals, part 1: variables, types, and control flow. We start actually writing the language.