SpringBoot Hello World Example

In this tutorial, we will learn about how to create a SpringBoot Hello World Example.

Spring Boot is a solution from Spring team for creating stand-alone, production-grade Spring-based Applications that you can “just run”. Spring Boot helps to build Spring based applications quickly and easily. The main goal of Spring Boot is to quickly create Spring based applications without requiring the developers to write the same boilerplate configuration again and again. Spring Boot is designed to simplify the bootstrapping and development of a new Spring application. Spring Boot favors convention over configuration design paradigm and is designed to get a Spring application up and running with very little configuration.

What you’ll need to create SpringBoot Hello World Example.

  • An IDE (Eclipse/Intellij – we will use Intellij)
  • JDK 1.8 or later
  • Gradle 2.3+ or Maven 3.0+ (We will use Gradle)

In order to create a SpringBoot Hello World example we need to create the SpringBoot main Application class. So let’s create the directory structure.

Create the directory structure:

In your project directory be it C drive or any other drive, create the following directory structure; for ex. net/javaforyou/springboot:


Create a Gradle build file:

Below is the initial Gradle build file.

Now, we need to create the SpringBoot application class. Let’s create it.

SpringBootDemo.java:

We have done the required setup and created the main class. Let’s run the SpringBoot main class and check the output.

Output:

We have now successfully created a SpringBoot Hello World example using SpringBoot and Gradle.

Related posts

Leave a Comment