Building a Spring Boot application using IntelliJ IDEA

Updated on February 3rd, 2020

In this quick post, we will learn about building a Spring Boot application using IntelliJ. The main purpose of this post is to help anyone new to Spring Boot get rolling quickly writing Spring applications with Spring Boot in IntelliJ. If you are a beginner with Spring Boot, I highly recommend starting with our Spring Boot.



IntelliJ IDEA is the most popular Java IDE. IntelliJ IDEA  provides first-class support to create and run Spring Boot based applications. We can create and configure Spring Boot application in the following ways.

  • Import Spring Boot project in IntelliJ IDEA.
  • Use built-in support for Spring Initializr in the IntelliJ IDEA  editor.

We are using the built-in support of the IDE to create our Spring Boot application.

Spring Boot is available in the Ultimate edition only.


1. Create Spring Boot Project With IntelliJ

To start, the process, open IntelliJ IDEA and click on the new project option.

Build a Spring Boot application using IntelliJ IDEA


2. Select Spring Initializr from the project type on the left side panel. Select the correct JDK from the Project SDK drop-down (Spring Boot 2.x require a minimum JDK 8).

Build a Spring Boot application using IntelliJ IDEA


3. Enter the Maven project properties as per your project requirements and click on the next step.

Build a Spring Boot application using IntelliJ IDEA


4. Select the Spring Boot version and other required dependencies for your project. Based on the selected dependencies, it will add correct Spring Boot Starters in the pom.xml file.

Build a Spring Boot application using IntelliJ IDEA


5. In the last part of the wizard, we need to select a project name and project location. Once selected click on the “Finish” button.

Build a Spring Boot application using IntelliJ IDEA


Once finished, IntelliJ IDEA import all the required dependencies and open the newly created a project to work on.

Build a Spring Boot application using IntelliJ IDEA


2. The pom.xml file

The pom.xml file contains all the building blocks for the Spring Boot application. Open the pom.xml file in the project’s root module.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
   <description>How to create Spring Boot project using IntelliJ</description>
      <relativePath />
      <!-- lookup parent from repository -->

We added spring-boot-starter-parent as the parent of our Spring Boot project. This parent provides several features in the Spring Boot application

  • Configuration – Java Version and Other Properties.
  • Dependency Management – Version of dependencies
  • Default Plugin Configuration

For more detail, read What is Spring Boot


3. Spring Boot Main Application Class

When we created this project, Spring Initializr created the following class automatically to start our Spring Boot application.

package com.javadevjournal.demoproject;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class SampleProjectIntelliJApplication {
   public static void main(String[] args) {, args);


4. Run Application

Spring Boot main class contains the main method. This is just a standard method that follows the Java convention for an application entry point. Our main method delegates to Spring Boot’s SpringApplication class by calling runSpringApplication bootstraps our application, starting Spring. We can run our application from the IntelliJ by clicking on the run application icon

Build a Spring Boot application using IntelliJ IDEA

As an alternative, we can use the run goal to start our application. Type mvn spring-boot:run from the root project directory to start the application. You should see output similar to the following.

Build a Spring Boot application using IntelliJ IDEA


Read our article Building an Application with Spring Boot to build a web application using Spring Boot



In this small post, we covered building a Spring Boot application using IntelliJ. IntelliJ is really a powerful editor and provides first-class support to create and run Spring Boot based web applications.

5 1 vote
Article Rating

Java Development Journal

Hello!! Welcome to the Java Development Journal. We love to share our knowledge with our readers and love to build a thriving community.

follow me on:
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newest Most Voted
Inline Feedbacks
View all comments
1 year ago

good job

1 year ago

good learning course. it is easy to learn and understand.

Java Development Journal
1 year ago
Reply to  BegExp

Thanks for your feedback!!!

Chandni Dassani
1 year ago

Hi, I followed same steps, but it cannot import springBoot packag. Got error will running application
“Error:(3, 32) java: package org.springframework.boot does not exist”.

Do we need to do some extra stuff?Please help

Java Development Journal
1 year ago

Are you using Intellij or did you imported the project in the IDE? Need more information to help you.Creating new application with Intellij is quite easy and clear, all you need to follow the creation Wizard.

1 year ago

Thanks bro

Java Development Journal
1 year ago
Reply to  Hlela


JJ Gua
8 months ago

I followed the exact steps and got ‘Whitelabel Error Page’ at localhost 8080

Java Development Journal
8 months ago
Reply to  JJ Gua

did you get any error? What is the Spring Boot version you are using?

5 months ago
Reply to  JJ Gua

Create a controller like below then it will work.

package com.javadevjournal.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

public class HelloWorldController {

public String helloWorld(){
return “Hello World!!”;

Ahsan Ali
7 months ago

Great! BLOG

Java Development Journal
7 months ago
Reply to  Ahsan Ali


7 months ago

I followed the same steps using gradle. But I got below error”TLS Server certificate issued after 2019-04-16 and anchored by a distrusted legacy Symantec root CA: CN=VeriSign Class 3 Public Primary Certification Authority – G5, OU=”(c) 2006 VeriSign, Inc. – For authorized use only”, OU=VeriSign Trust Network, O=”VeriSign, Inc.”, C=US

Java Development Journal
7 months ago
Reply to  subha

Which JDK version are you using? There was one change in the JDK which can cause issue if the cert issued after April 16, 2019.Please refer to the following ticket for more detail

17 days ago

Hey, I built my project following the instructions but i set the type to Gradle. When i run my main application class, i get the error “Process ‘command ‘C:/Program Files/Java/jdk1.8.0_251/bin/java.exe” finished with non-zero exit value 1″. Any idea on how to tackle this? Thanks!

Java Development Journal
17 days ago
Reply to  borosite

Is that the complete error? Do you see any other error in the console?

Would love your thoughts, please comment.x