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
- Download JDK 17 or 21 installer.
- Run the installer and note the install path.
- Set environment variables:
JAVA_HOME= your JDK directory- Add
%JAVA_HOME%\bintoPATH
macOS
- Install with Homebrew:
brew install openjdk@21- Follow Homebrew output to link/export Java in your shell profile.
Linux (Ubuntu / Debian)
sudo apt update
sudo apt install openjdk-21-jdkVerify Java Installation
Run:
java -version
javac -version
echo %JAVA_HOME% # Windows
echo $JAVA_HOME # macOS/LinuxYou should see:
- Java major version
17or21 javacavailable on PATHJAVA_HOMEpointing 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
- Download binary zip from Maven official site.
- Unzip to a folder (for example
C:\tools\apache-maven-3.9.x). - Set:
MAVEN_HOME= Maven folder- Add
%MAVEN_HOME%\bintoPATH
macOS
brew install mavenLinux (Ubuntu / Debian)
sudo apt update
sudo apt install mavenVerify Maven Installation
Run:
mvn -versionExpected output characteristics:
- Maven version displays correctly
- Java version is
17or21 - 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:
- Install IntelliJ IDEA.
- Open
Settings(orPreferenceson macOS). - Configure:
- Project SDK -> JDK 17/21
- Build Tools > Maven -> use local Maven or bundled Maven consistently
- Enable auto-import for Maven projects.
Configure Maven in IntelliJ
Inside IDEA:
- Confirm JDK in:
Project Structure > Project SDKBuild, Execution, Deployment > Build Tools > Maven > Runner > JRE
- Confirm Maven home in:
Build Tools > Maven
Keep IDE and terminal aligned:
- Terminal
mvn -versionJava version == IDEA Maven Runner Java version
Common Setup Problems and Fixes
java command not found
PATHmissing JDKbin- Terminal not restarted after env var update
mvn command not found
MAVEN_HOMEnot set (Windows)- Maven
binnot inPATH
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:
java -version
javac -version
mvn -versionHealthy environment checklist:
- Java and
javacare 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.