Spring Boot, the popular Java-based framework, simplifies building stand-alone, production-ready applications. This tutorial will guide you through creating a simple Spring Boot application, step-by-step, from project creation to running your first endpoint.

By the end of this guide, you'll have a solid introduction to Spring Boot's core features, including dependency management, automatic configuration, and embedded servers.

Setting Up Your Development Environment
Before you start, ensure you have Java (1.8 or later) and Apache Maven (3.6 or later) installed on your system. You can verify the installations by running the following commands:

$ java -version <br />$ mvn -version
Creating a New Spring Boot Project

Open your terminal/command prompt and navigate to the directory where you'd like to create your project. Then, run:
$ spring init --dependencies=web --lang=java --name=my-first-spring-app --version=1.0.0
The spring init command generates a new Spring Boot project with the 'web' dependency, sets the name and version, and JDK compliance. After completion, navigate into your new project:

Exploring Project Structure
Use the following commands to navigate into your project and list the files:
cd my-first-spring-app <br />ls

You'll see a *.iml and pom.xml file, a src/main/java folder containing the Application.java file, and the target directory. Note that the .iml file is for IntelliJ IDEA and doesn't affect your project functionality.
Running Your First Spring Boot Application









apunhRun your application using Maven with the following command:
mvn spring-boot:run
Open your browser and navigate to http://localhost:8080 to see your application running. The default Spring Boot page lists the application's healthy status and provides an informative 'Whitelabel Error Page' if you trigger an error.
Creating Your First REST Endpoint
Open Application.java and modify the main method to create and configure an instance of Spring Boot's WebApplicationType:
@SpringBootApplication
public class MyFirstSpringAppApplication {
public static void main(String[] args) {
SpringApplication.run(MyFirstSpringAppApplication.class, args);
}
}Create a new class called HelloWorldController in the same package and add the following.java file:
Mapping Your First Route
Tell Spring Boot to map a route to your controller by using the @GetMapping annotation. Open HelloWorldController.java and add the following code to map the route to your default page:
@RestController
public class HelloWorldController {
@GetMapping("/")
public String helloWorld() {
return "Hello, World!";
}
}Restart your application using mvn spring-boot:run and open your browser to http://localhost:8080. You should now see the text "Hello, World!" displayed instead of the default Spring Boot page.
Your first Spring Boot application is now complete! This exercise serves as a solid foundation for building more complex applications using Spring Boot's extensive feature set. Start exploring other components of Spring Boot, such as Spring Data for database access and Spring Security for authentication and authorization.