Share
Sharing is caring, pass this along to others who might find it useful or inspiring.
2025-09-25T05:51:42.000Z • 3 mins
Introduction:
Let’s start with an example, when creating a web application, the development process must be as fast and efficient as possible, and the configuration must be minimal. Setting up a Spring-based project has traditionally been a problem because it often requires extensive XML configuration, dependency management, and boilerplate code, which slows down development time and increases complexity.
However, Spring Boot simplifies this process, allowing you to quickly generate production-ready Spring applications with minimal configuration.
In this blog, we will walk you through setting up Spring Boot using Maven and Gradle, covering the installation process and system requirements. Let’s get started!
Getting Started with Spring Boot: Essential Prerequisites
Before getting started with Spring Boot, make sure you have the following in place:
Java Spring Boot applications are written in Java, so you must have Java installed on your system. Spring Boot is compatible with Java 8, 11, 16, and 17 . Ensure your environment variables are properly configured.
Integrated Development Environment (IDE)
You can use any Java IDE of your choice for Spring Boot development. Popular options include Eclipse, IntelliJ IDEA, Visual Studio Code. Among these, I personally recommend IntelliJ IDEA, as it provides powerful features, seamless integration with Spring Boot, and an overall smooth developer experience. IntelliJ’s intelligent code assistance, built-in Spring support, and wide range of plugins make it an excellent choice for both beginners and experienced developers.
3. Installing Spring Boot
You can use Spring Boot with standard Java tools (STS) or as a command-line tool. Either way, Java SDK 17 or higher is required. Check your version using:
$ java -version
If you’re new to Java or want to experiment quickly, start with the Spring Boot CLI. Otherwise, follow the traditional setup instructions below.
4. Step-by-Step Guide: Spring Boot Setup via Spring Initializr
Step 1: Go to Spring Initializr
Open your browser and visit: https://start.spring.io
Screenshot from official Spring Boot
Step 2: Fill Project DetailsYou’ll see a form where you can configure your project:
Project: Choose Maven or Gradle
Language: Select Java
Spring Boot version: Use the latest stable version
(e.g., 4.0.0 (SNAP SHOT), 4.0.0 (M1), 3.5.5 (SNAP SHOT), 3.4.9 (SNAP SHOT) 3.4.8 etc..)
Project Metadata:
Group : e.g. com.example
Artifact : e.g. demo
Name : demo
Description : Simple Spring Boot project
Package Name : auto-filled
Packaging : Jar
Java : 24, 21, 17 or (based on your JDK)
Step 3: Add DependenciesDependencies are modules or libraries that add functionality to your project like connecting to a database, creating REST APIs, handling security, or rendering web pages. Spring Boot makes this easy by offering a wide range of pre-packaged starters.
When you use Spring Initializr, you simply select the features you need, and it adds the appropriate dependencies to your project’s build file (pom.xml for Maven or build.gradle for Gradle).
Click “Add Dependencies” and search what dependencies we need:
Spring Web (for REST APIs)
Spring Boot Dev Tools (for auto-reload during development)
Spring Data JPA (for database access)
H2 Database (for in-memory DB testing)
Screenshot from official Spring Boot
Step 4: Generate Project
Click the “ Generate ” button.
A .zip file will be downloaded with your project structure.
Step 5: Unzip & Open in IDE
Unzip the file
Open the folder using IntelliJ IDEA, Eclipse, or VS Code
If you’re using IntelliJ IDEA:
Choose File > Open > Select the folder
Let it import Maven/Gradle dependencies
Now all the dependencies are loaded successfully
Screenshot from official Spring Boot
Step 6: Run the Application
Navigate to the main class DemoApplication.java (inside src/main/java/…)
5. Go to Main Class : The main class will look like below
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
@SpringBootApplication annotation tells Spring Boot that this is the entry point for your application.
6. Write Your First Controller: Create a simple controller class that handles HTTP requests. Use annotations like @RestController and @RequestMapping to define your endpoints and methods. Your main class will look like this now.
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@GetMapping("/hello")
public String sayHello() {
return "Hello, Spring Boot!";
}
}
7. Run Your Application: Run the main class (typically named Application) in your IDE or use terminal commands (./mvnw spring-boot:run for Maven, ./gradlew bootRun for Gradle). In IDE right-click on your project select run as spring boot app.
8. Access Your App: Open a web browser and go to http://localhost:8080/hello to see your Spring Boot application in action and you will get “Hello, Spring Boot!”.Your Spring Boot app is now up and running at Tomcat Server (Apache tomcat) with certain port (http://localhost:8080)
Another Scenario:
Explore Zip
Click on “Build Gradle”
Select dependencies from build Gradle and then copy.
Search & Copy Dependency for Maven/Gradle
1. Open browser in your PC/Laptop
2. Search Mavan Repository or Copy and paste to search the link https://mvnrepository.com/
Screenshot from official Maven Repository
3. Search for the dependency (e.g., spring-boot-starter-web)
4. Click on the correct library and version
5. Scroll down to find dependency code like this:
For Maven (pom.xml):
Screenshot from official Maven Repository
Gradle :
Screenshot from official Maven Repository
ConclusionSpring Boot makes it simple to build, run, and manage Java applications. It helps developers start projects faster with very little setup, thanks to built-in support for tools like Maven and Gradle. Features like automatic configuration, built-in servers, and helpful developer tools save time and effort.
Whether you’re building something small with the Spring Boot CLI or adding it to a bigger project, Spring Boot gives you a strong, easy-to-use foundation for apps that can grow and are easy to maintain.
“In today’s fast-paced tech world,
efficiency is essential
. Spring Boot offers a streamlined development approach that
saves time, minimizes errors, and makes building applications faster and smoother
.”
Simplifying Spring Boot Setup: Step-by-Step Process to Spring Initializer was originally published in tech.at.core on Medium, where people are continuing the conversation by highlighting and responding to this story.