Creating your first Spring Boot launch class

The following class explains how to create a simple Spring Boot launch class. It uses the static run method from the SpringApplication class, as shown in the following code snippet:

    package com.mastering.spring.springboot;     import org.springframework.boot.SpringApplication;     import org.springframework.boot.    autoconfigure.SpringBootApplication;     import org.springframework.context.ApplicationContext;     @SpringBootApplication public class Application {       public static void main(String[] args)        {          ApplicationContext ctx = SpringApplication.run          (Application.class,args);         }     }

The preceding code is a simple Java main method executing the static run method on the SpringApplication class.

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.