Installing Java, Maven, and IntelliJ IDEA for Spring Boot 3

Introduction

Before you write your first Spring Boot 3 endpoint, your local environment must be stable and predictable. In this chapter, you will install JDK 17/21, Maven, and IntelliJ IDEA, then verify the toolchain with a short checklist. A clean setup now saves hours of debugging later.

Prerequisites

  • Basic command-line usage
  • Administrator access on your machine (for installation and PATH updates)
  • Internet access for downloading tools

Why These Versions Matter

Spring Boot 3 requires a modern Java baseline and ecosystem compatibility:

  • Java 17+ is required by Spring Framework 6 / Spring Boot 3
  • Maven 3.9+ is recommended for modern plugin and dependency resolution behavior
  • IntelliJ IDEA 2023+ provides reliable Spring and Maven support

Tip

Recommended Combo

Use Java 21 + Maven 3.9.x + IntelliJ IDEA 2024+ for new projects. This combination is stable, widely adopted, and future-proof for Boot 3.x learning.

Install JDK (17 or 21)

You can use any OpenJDK distribution (Temurin, Oracle, Corretto, Zulu, and so on). For most learners, Temurin is a safe default.

Windows

  1. Download JDK 17 or 21 installer.
  2. Run the installer and note the install path.
  3. Set environment variables:
    • JAVA_HOME = your JDK directory
    • Add %JAVA_HOME%\bin to PATH

macOS

  • Install with Homebrew:
bash
brew install openjdk@21
  • Follow Homebrew output to link/export Java in your shell profile.

Linux (Ubuntu / Debian)

bash
sudo apt update
sudo apt install openjdk-21-jdk

Verify Java Installation

Run:

bash
java -version
javac -version
echo %JAVA_HOME%   # Windows
echo $JAVA_HOME    # macOS/Linux

You should see:

  • Java major version 17 or 21
  • javac available on PATH
  • JAVA_HOME pointing to a valid JDK directory

Warning

Do not mix multiple old JDKs in PATH order. If java -version and IDEA show different JDKs, builds may fail with confusing errors.

Install Maven

Maven handles dependency management and packaging for this track.

Windows

  1. Download binary zip from Maven official site.
  2. Unzip to a folder (for example C:\tools\apache-maven-3.9.x).
  3. Set:
    • MAVEN_HOME = Maven folder
    • Add %MAVEN_HOME%\bin to PATH

macOS

bash
brew install maven

Linux (Ubuntu / Debian)

bash
sudo apt update
sudo apt install maven

Verify Maven Installation

Run:

bash
mvn -version

Expected output characteristics:

  • Maven version displays correctly
  • Java version is 17 or 21
  • Maven home path is valid

If Maven uses the wrong Java version, re-check JAVA_HOME and restart your terminal.

Install IntelliJ IDEA

Use IntelliJ IDEA Community (enough for this track) or Ultimate.

Key setup steps:

  1. Install IntelliJ IDEA.
  2. Open Settings (or Preferences on macOS).
  3. Configure:
    • Project SDK -> JDK 17/21
    • Build Tools > Maven -> use local Maven or bundled Maven consistently
  4. Enable auto-import for Maven projects.

Configure Maven in IntelliJ

Inside IDEA:

  • Confirm JDK in:
    • Project Structure > Project SDK
    • Build, Execution, Deployment > Build Tools > Maven > Runner > JRE
  • Confirm Maven home in:
    • Build Tools > Maven

Keep IDE and terminal aligned:

  • Terminal mvn -version Java version == IDEA Maven Runner Java version

Common Setup Problems and Fixes

java command not found

  • PATH missing JDK bin
  • Terminal not restarted after env var update

mvn command not found

  • MAVEN_HOME not set (Windows)
  • Maven bin not in PATH

Maven runs with wrong Java version

  • Another Java appears first in PATH
  • IDEA uses different JDK than terminal

SSL / dependency download issues

  • Corporate proxy not configured
  • Mirror/proxy settings missing in Maven settings.xml

Quick Health Check Script

Run these commands before starting chapter 03:

bash
java -version
javac -version
mvn -version

Healthy environment checklist:

  • Java and javac are available
  • Maven runs successfully
  • Maven reports Java 17/21
  • IDEA Project SDK is the same Java version

What’s Next

Your environment is ready. In the next chapter, you will create the first Spring Boot 3 project with Spring Initializr, run it locally, and package it as an executable JAR.

FAQ

Should I choose Java 17 or Java 21?

Both work with Spring Boot 3. If you are starting fresh, Java 21 is a great default; Java 17 is also very common in enterprise environments.

Do I have to install Maven manually on Windows?

You can, but many developers use package managers too. Manual installation is good for learning because you understand MAVEN_HOME and PATH clearly.

Can I use Gradle instead of Maven in this tutorial?

Yes, Spring Boot supports both. This track uses Maven examples by default for consistency with the site’s existing Java ecosystem content.

Why does IDEA build pass but terminal build fail?

Usually because they use different JDK or Maven settings. Align Project SDK, Maven Runner JRE, and terminal JAVA_HOME.

Is IntelliJ Community enough for Spring Boot learning?

Yes. Community edition is enough for core Boot development in this series.