Getting Started with Spring Boot Project
Let’s get started with the tutorial straight away.
Downloading latest Java version
Download the latest Java version from the below link and install it:
https://www.oracle.com/java/technologies/downloads/#jdk23-windows
After the installation, open your CMD, paste the command “java --version” and check the Java version.
Getting IntelliJ IDEA Community Edition
To work upon the Spring Boot project, we will need an IDE. So, let’s download IntelliJ IDEA Community Edition using the following link.
https://www.jetbrains.com/idea/download/?section=windows
Make sure you download the community edition as it is free.
Initializing the Spring Boot Project
Now that we are set with Java. It’s time to initialize our Spring Boot project using the Spring Initializr on your browser.
https://start.spring.io/
This is a setup screen for creating a new Spring Boot project.
Project Type: Using Maven (a tool to manage the project).
Language: Java is selected.
Spring Boot Version 3.4.2 is chosen. (Always go with the latest stable version and avoid snapshot versions)
Project Details:
Group: com.myproject (like a company or organization name).
Artifact: my project (the project name).
Name: my project (same as Artifact).
Description: A short note about the project.
Package Name: com.myproject (used for organizing files in code).
Packaging Type: Jar (a package format for Java programs).
Java Version: 23 (latest Java version).
This setup will generate a new Spring Boot project that you can start coding in Java.
Click on the “Generate” button and a zip file will be downloaded.
Importing the Spring Boot Project in IDE
Now locate the downloaded zip
Extract it where you want your project to be.
Open IntelliJ IDE
Click on the “Open” button
Locate the extracted folder (select the child folder with the same name if exists. In my case it does)
Select it and click “Ok.”
Running your Spring Boot Application
In the src/main/java/com.myproject exists our entry for the Spring Boot application project.
Select the MyProjectApplication class and then run it by clicking the play button at the top of the IDE. (keep “Current File” as the file to run)
Your project should start without any error.
Happy Coding 🎉🎉!