Create a Spring Boot Project - 2

 In this blog, we are going to learn, how to create a spring boot project. This is our first creation of a spring boot project. Typically two way we can create java spring boot project. 

  1. Using Spring Initializr
  2. Direct in IDE
Spring Initializr is an online UI that provides to initialize a project for Java, Kotlin, and Groovy. This UI is very clear to create a Java Spring Boot project. As beginners first, we will create a spring boot project using Spring Initializr. Then in the next blog, we will create the project in IDE.

Below are the all steps to initialize a Java Spring Boot project and import in Intellij idea.

Step 1: Initialize a spring boot project.

Spring Boot Project Initialization

Explain the all option here - 
  1. Project : Dependency Type (Maven)
  2. Language: Programming Language (Java)
  3. Spring Boot Version: 3.3.1
  4. Packaging: Jar file typically used for standalone applications (Like API, Microservices). War file used for web application. (Like Java EE Application)
  5. Java: Version of JDK(17)
  6. Add Dependency: We can add Maven dependency(MySql, Lombok) during initializing a project.
  7. Finally click on GENERATE then it will automatically start downloading the project as a zip file.
Step 2: Open spring boot project in IntelliJ idea. Just follow the bellow screenshot to open simply your spring boot project.

Open Spring Boot project in Intellij Idea


Open Spring Boot project in Intellij Idea

SDK related bug fix
If you already have SDK in your machine but still facing this issue then just follow the below two screenshot. Otherwise skip below two screenshot.

SDK related bug fix
Click on Setup SDK

SDK related bug fix
My JDK version is 19. Therefore it shows JDK 19. Just select your JDK from here.

SDK related bug fix
Finally solved the JDK issue. Remember you must install JDK before creating a project.

Run Spring Boot Project in Intellij Idea
Finally, run the main class.

See, our project run successfully in embedded Tomcat server 8080 port. 👍

In the next blog, we will create two simple APIs with the GET method. We will call those APIs from the browser to get data from the server in JSON format.










Post a Comment

0 Comments