Spring Boot

Article 2: Setting Up Spring Boot Locally

By Utility Zone · 2026-01-27T18:30:51.106534

1. Introduction

Before writing real Spring Boot code, your local setup must be correct and clean.

A bad setup causes:

  • Version conflicts
  • Build failures
  • Confusing errors for beginners

In this article, we will set up Spring Boot step by step, the same way it’s done in real projects.


2. Java Development Kit (JDK)

2.1 Recommended JDK Version

For modern Spring Boot projects:

  • ✅ JDK 17 (Recommended)
  • JDK 21 (also supported, optional)

Avoid:

  • JDK 8 (legacy)
  • JDK 11 (being phased out)

2.2 Verify Java Installation

Run:

java -version

Expected output:

java version "17.x.x"

If Java is not installed, install:

  • OpenJDK 17
  • Oracle JDK 17

3. Build Tool: Maven vs Gradle

3.1 Maven (Recommended for Beginners)

Why Maven?

  • Simple lifecycle
  • XML-based (easy to read)
  • Widely used in enterprises

3.2 Gradle

  • Faster builds
  • Groovy/Kotlin DSL
  • Slight learning curve

👉 For this roadmap, we will use Maven.


4. IDE Setup

4.1 Recommended IDEs

  • IntelliJ IDEA (Community is enough)
  • VS Code (with Java + Spring extensions)

4.2 Required Plugins (If Using VS Code)

  • Java Extension Pack
  • Spring Boot Extension Pack

5. Creating Project Using Spring Initializr

5.1 What Is Spring Initializr?

Spring Initializr is an official project generator that:

  • Creates correct project structure
  • Manages dependency versions
  • Avoids misconfiguration

URL: https://start.spring.io


5.2 Project Configuration (Important)

Fill the form as follows:

  • Project: Maven
  • Language: Java
  • Spring Boot: 3.x.x
  • Group: com.example
  • Artifact: demo
  • Packaging: Jar
  • Java: 17

5.3 Dependencies to Add

Add:

  • Spring Web

(We’ll add database and security later)


6. Importing Project into IDE

6.1 IntelliJ

  • Extract zip
  • Open folder
  • Wait for Maven to download dependencies

6.2 VS Code

  • Open folder
  • Accept Java workspace prompts

7. Running Spring Boot Application

7.1 From IDE

  • Run DemoApplication.java
  • Look for:
Started DemoApplication in X seconds

7.2 From Terminal

./mvnw spring-boot:run

or

mvn spring-boot:run

8. Verify Application Is Running

Open browser:

http://localhost:8080

You’ll see:

  • Whitelabel Error Page (Expected)

This confirms:

  • App is running
  • Embedded Tomcat started

9. Common Beginner Issues

Issue 1: Port 8080 Already in Use

Solution:

server.port=8081

Issue 2: Maven Not Found

  • Use ./mvnw (Maven Wrapper)
  • Or install Maven manually

10. What You Should Have Now

By the end of this article, you should have:

  • Java 17 installed
  • Spring Boot project created
  • Application running locally
  • Confidence that setup is correct

11. What’s Next?

➡ Article 3: Understanding Spring Boot Project Structure

  • @SpringBootApplication
  • application.properties
  • pom.xml deep dive