Spring Boot Tutorial
Spring Boot - Software Setup and Configuration (STS/Eclipse/IntelliJ)
Prerequisite (Spring Core Concepts)
Spring Boot Core
Spring Boot with REST API
Spring Boot with Database and Data JPA
Spring Boot with Kafka
Spring Boot with AOP
Spring Tool Suite (STS) is an Integrated Development Environment (IDE) tailored specifically for Spring development. Running a Spring Boot application in STS is quite straightforward.
Follow these steps to run your first Spring Boot application in Spring Tool Suite:
If you haven't installed it yet:
SpringToolSuite4
executable.File
-> New
-> Spring Starter Project
.STS will generate a Spring Boot project with the selected dependencies.
Now, let's create a simple controller:
New
-> Class
.HelloController
and click "Finish".package com.example.demo; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @GetMapping("/hello") public String sayHello() { return "Hello, Spring Boot!"; } }
YourProjectNameApplication
and has the @SpringBootApplication
annotation).STS will start your application. You'll know it's running when you see log entries in the console, including a line that looks like:
Started YourProjectNameApplication in X seconds (JVM running for Y)
Once the application starts successfully, open a web browser and navigate to:
http://localhost:8080/hello
You should see the message "Hello, Spring Boot!"
Congratulations! You've just run your first Spring Boot application in Spring Tool Suite. As with any IDE, the more you use STS, the more familiar you'll become with its features and shortcuts.