Featured Article

Step-by-Step Guide: How to Set Up Spring Boot in IntelliJ IDEA Easily

Kenneth Jul 13, 2026

Embarking on a new Spring Boot project? IntelliJ IDEA, a popular Java IDE, can streamline your development experience. This guide will demonstrate how to set up Spring Boot in IntelliJ in a few straightforward steps.

Spring Boot Annotations Cheat Sheet (Save This!)
Spring Boot Annotations Cheat Sheet (Save This!)

Before we dive in, ensure you have the following installed: Java Development Kit (JDK) 1.8 or later, IntelliJ IDEA (Community or Ultimate edition), and an active internet connection for downloading dependencies.

Spring Boot MongoDB Java Tutorial With Examples - JavaTechOnline
Spring Boot MongoDB Java Tutorial With Examples - JavaTechOnline

Preparing the Environment

Let's begin by ensuring your IntelliJ IDEA is up-to-date and configured to work with Spring Boot.

Reactive Spring Boot: Part 5: Auto-configuration for Shared Beans
Reactive Spring Boot: Part 5: Auto-configuration for Shared Beans

First, open IntelliJ IDEA and go to 'Preferences' (macOS) or 'Settings' (Windows/Linux). Navigate to 'Plugins' and search for 'Spring Boot Dashboard'. Install it if not already present. This plugin provides a user-friendly interface for managing Spring Boot dependencies.

Configuring Java

Java + Spring Boot + Microservices Example - Step by Step Guide
Java + Spring Boot + Microservices Example - Step by Step Guide

IntelliJ IDEA needs to know where your JDK is located. Go to 'Preferences' / 'Settings', then 'Build, Execution, Deployment', and 'Java Compiler'. Specify the path to your JDK in 'Java SDK'.

Additionally, ensure that 'Use project SDK' is checked under 'Project') in the 'Project Structure' dialog (accessible via 'File' > 'Project Structure' or Ctrl+Shift+Alt+S).

Setting up the Project

Part 1 - Initial Setup in IntelliJ of FleetMS v2 with Spring Boot
Part 1 - Initial Setup in IntelliJ of FleetMS v2 with Spring Boot

Now let's create a new Spring Boot project. Choose 'New Project' from the welcome screen or click on 'File' > 'New' > 'Project'. Select 'Spring Initializr' as the template. Click Next.

Spring Initializr helps configure your project with the necessary dependencies. Choose 'Maven' as the project, enter your Group, Artifact, and Version details, and click 'Next'. Select the dependencies you need (e.g., 'Web', 'JPA', etc.) and click 'Next' again. Choose a project name and location, then click 'Finish'.

Running and Testing your Application

Spring Boot Tutorial for Beginners 7 - Spring Data JPA
Spring Boot Tutorial for Beginners 7 - Spring Data JPA

Now that your project is set up, let's run and test your Spring Boot application.

IntelliJ IDEA provides multiple ways to run your application. The simplest is clicking on the green 'Run' button atop the toolbar. This will launch your application on the built-in Tomcat server.

How To Work With Apache Kafka In Spring Boot?
How To Work With Apache Kafka In Spring Boot?
How to Style Boots in Spring – How to Transition Into Spring
How to Style Boots in Spring – How to Transition Into Spring
Login and Signup with Java and Spring Boot
Login and Signup with Java and Spring Boot
a pair of boots with flowers in them sitting in the middle of a grassy field
a pair of boots with flowers in them sitting in the middle of a grassy field
a pair of boots with flowers in them sitting on a stump
a pair of boots with flowers in them sitting on a stump
Kira's outdoor mat
Kira's outdoor mat
Spring outfits and flowers
Spring outfits and flowers
What Goes With Spring Boots? Outfit Ideas That Always Work πŸŒΈβœ¨πŸ‘’
What Goes With Spring Boots? Outfit Ideas That Always Work πŸŒΈβœ¨πŸ‘’
25 Creative Spring Boot Planter Ideas for Charming Garden Decor
25 Creative Spring Boot Planter Ideas for Charming Garden Decor

Using Spring Boot Run/Debug Configuration

For more control over your application's lifecycle, create a Run/Debug configuration. Go to 'Run' > 'Edit Configurations'. Click '+', select 'Spring Boot', and name your configuration. In the 'Main' field, enter the fully qualified path to your application's main class. Click 'OK' to save.

To run your application using this configuration, select it in the Run/Debug selection toolbar and click the green 'Run' or 'Debug' icon.

Writing and Running Tests

Spring Boot projects are set up with testing frameworks (like JUnit and Mockito) out-of-the-box. Write your tests in a class annotated with '@RunWith(SpringRunner.class)' and '@SpringBootTest'. Place test classes in the 'test' or 'test/java' folder.

To run tests, highlight the test class(es) and right-click. Choose 'Run 'context-click-test-class''. Alternatively, run all tests by triggering the 'Run All Tests' action or by accessing the 'Run' menu.

There you have it! You've successfully set up a Spring Boot project in IntelliJ IDEA and learned how to run and test your application. As you progress, exploring IntelliJ IDEA's features and keyboard shortcuts can enhance your productivity. Happy coding!