Java, Software Development, Spring Boot

Create a Spring Boot Application using IntelliJ

Using Spring Boot is the fastest way to get up to speed in developing modern applications. But how do we create the initial codebase that works out of the box? There are three ways – by hand, the Spring Initialzr, and the IntelliJ IDE. This post shows how to create Java Spring Boot applications in IntelliJ. As you may not know yet, Spring Boot allows for the rapid development of applications. One of the essential benefits of using Spring Boot is that it bundles most of the dependencies we need.

The was a time when developers needed to ensure various library files were compatible or rely on a list of known versions that worked.

IntelliJ IDE

I am using a licensed version, but the Community Edition would provide enough features for our purpose.

Create a new Spring Boot Project

1. Open IntelliJ. Then, choose File > New > Project…

A window opens. Choose Spring Initilzr.

Suppose you don’t have IntelliJ installed; head to h https://start.spring.io using a web browser. It will enable you to generate the Spring Boot application online and download the project as a zip file.

Then, click Next.

2. Specify details for the build system

Specify some details for the build system. We can even select which build system to use – Maven or Gradle (see Type field). Then, click Next.

3. Choose Dependencies

Instead of dealing with jar dependencies directly, we now deal with “module” dependencies. Each “module” is a bundle of related jar files.In this post, we select “Web” and “Thymeleaf.” Then, click Next.

4. Complete the process

create Spring Boot IntelliJ

Run Your Spring Boot Application From IntelliJ

At this point, we have created a Spring Boot application that works, and we can run it from the IntelliJ IDE. To run it from the IDE, execute the following class.

create Spring Boot IntelliJ

For simplicity, you would execute the main class shown in the screenshot below.

create Spring Boot IntelliJ

Hereafter, we can work on databases or even queues. And that’s how we create a Spring Boot application within the IntelliJ IDE!

Create Spring Boot in IntelliJ Demo

Here is a quick demo of creating a Spring Boot application in IntelliJ.

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like