Spring Boot Mastery: Installing Java & IntelliJ IDEA on Windows 11
Setting up a predictable, production-ready Java development environment requires configuring both an Integrated Development Environment (IDE) and a Java Development Kit (JDK). This chapter walks through installing IntelliJ IDEA Community Edition, managing bundled vs. system-level JDKs, downloading Adoptium (Eclipse Temurin) Java 8, and configuring Windows Environment Variables (PATH) so that terminal commands and IDE projects remain perfectly synchronized.
1. Cross-Platform Setup Strategy
Although this guide focuses on Windows 11, the core concepts apply universally across macOS and Linux:
- Platform Agnosticism: IntelliJ IDEA handles JDK downloading, SDK switching, and build triggers inside the IDE environment.
- Separation of Responsibilities:
- IDE (IntelliJ IDEA): Handles code editing, auto-completion, refactoring, and execution triggers.
- JDK (Java Development Kit): Supplies the Java compiler (
javac), runtime environment (java), and core platform libraries.
2. Installing IntelliJ IDEA Community Edition
IntelliJ IDEA comes in two editions:
- Ultimate Edition: Commercial / Paid (includes advanced enterprise frameworks and database tools).
- Community Edition: Free / Open-Source (fully sufficient for core Java and Spring Boot development).
Installation Workflow
Key Feature — File Association (
.java): Checking the.javaassociation configures Windows to open raw.javafiles directly inside IntelliJ IDEA when double-clicked.
3. Bundled JDK vs. System JDK
IntelliJ IDEA can manage JDK installations independently of system-wide Java installations.
Advantages of IDE-Managed JDKs
- No need to manually configure system path variables to get started.
- Allows per-project JDK isolation (e.g., Project A uses Java 8, Project B uses Java 17).
- Automatically downloads build dependencies from multiple trusted vendors (Vendor/Provider abstraction).
4. Setting Up a JDK inside IntelliJ IDEA
When creating a new Java project without a pre-installed system JDK, IntelliJ provides an automated JDK downloader.
Step-by-Step IDE JDK Download
- Click New Project in IntelliJ.
- Under the JDK dropdown, select Download JDK.
- Select desired version and vendor:
- Version:
1.8(Java 8) - Vendor:
Eclipse Temurin (Adoptium)orAmazon Corretto/Oracle OpenJDK
- Version:
- Click Download. IntelliJ fetches and unpacks the JDK into its managed runtime folder.
// Sample generated starter program (Main.java)
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
5. System-Wide JDK Verification via Command Prompt
While IntelliJ can run projects using its internal JDK, build tools, global CLI scripts, and third-party frameworks often rely on a System-Wide JDK exposed via the command-line interface.
Checking System Java
Open Windows Command Prompt (cmd) or PowerShell and execute:
java -version
Possible Diagnostic Outputs
6. Installing Adoptium (Eclipse Temurin) Java 8
To ensure command-line utilities and the IDE run on the exact same Java baseline, install a standalone JDK build at the system level.
Why Java 8 Baseline?
Starting with Java 8 guarantees compatibility with legacy builds while maintaining explicit version control. Upgrading to Java 11, 17, or 21 later involves identical environment configuration steps.
Download & Installation Steps
- Visit adoptium.net (Eclipse Adoptium project).
- Go to Other platforms and versions -> Release Archive.
- Filter by:
- Operating System: Windows
- Architecture: x64
- Version:
8 - LTS - Package Type: JDK (MSI Installer)
- Run the downloaded
.msifile. - In the feature selection screen, enable Set JAVA_HOME variable and Add to PATH.
7. Understanding the Windows PATH Environment Variable
When you run java inside cmd, the Windows operating system does not automatically know where java.exe resides on disk. It relies on the PATH environment variable.
How Command Resolution Works
System Variables vs. User Variables
- User Variables: Apply exclusively to the currently logged-in Windows user account.
- System Variables: Apply globally across all user profiles on the computer.
Important: Changing environment variables does not update existing, open terminal windows. You must close and re-open the Command Prompt window for new
PATHentries to take effect.
8. Registering System JDKs inside IntelliJ IDEA
When new JDKs are installed at the system level, IntelliJ IDEA can detect them and make them available across all projects.
Accessing Project SDK Settings
- Open IntelliJ IDEA.
- Go to File -> Project Structure... (Shortcut:
Ctrl + Alt + Shift + S). - Under Project Settings, select Project.
- In the SDK dropdown, inspect detected JDK installations.
Troubleshooting — Unregistered System JDK: If a newly installed system JDK does not appear in the SDK list immediately, restart IntelliJ IDEA. Upon startup, the IDE scans default installation directories (
C:\Program Files\...) and automatically registers new JDK instances.
9. Real-World Debugging & Common Setup Pitfalls
Pitfall 1: Command Prompt Shows Wrong Java Version
- Symptom: Installed Java 8, but
java -versionreturns Java 11 or 17. - Root Cause: Another installation placed its
bindirectory higher up in thePATHvariable list. - Fix: Move
C:\Program Files\Eclipse Adoptium\jdk-8.0.xxx\binto the top of thePATHentries list in Windows Environment Variables.
Pitfall 2: java Command Fails after Successful Installation
- Symptom:
java -versionstill reports'java' is not recognizedafter running installer. - Root Cause: Terminal session was opened before installer modified environment variables.
- Fix: Kill the CMD process, launch a fresh CMD window, and re-run
java -version.
Pitfall 3: IntelliJ Project Fails to Compile (SDK not specified)
- Symptom: IntelliJ displays
Setup SDKbanner at the top of.javacode files. - Fix: Click Setup SDK -> Select installed JDK version -> Click Apply.
10. Summary and Key Takeaways
- IDE Selection: IntelliJ IDEA Community Edition provides full capability for standard Java and Spring Boot development without commercial licensing requirements.
- Decoupled JDK Strategy: IntelliJ can manage project JDKs independently via internal downloaders, but setting up a system-wide JDK is required for terminal tooling.
- System Java Verification:
java -versionexecuted in terminal checks system accessibility via path variable mappings. - Adoptium (Eclipse Temurin): A reliable, open-source production distribution of OpenJDK for system-wide Java installations.
- PATH Mechanics: The Windows
PATHenvironment variable tells the Command Prompt where binary executables (java.exe,javac.exe) reside. - Terminal Environment Refresh: Modifying environment variables requires restarting active terminal sessions (
cmd/PowerShell) to apply updates. - IDE Auto-Detection: Restarting IntelliJ IDEA triggers an environment scan, picking up newly installed system JDKs under
File -> Project Structure -> SDKs.