Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Environment Construction of spring boot

2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

4.0.0

Springstart

Com.zcp.springstart

1.0.0

Jar

UTF-8

1.7

1.7

Org.springframework.boot

Spring-boot-dependencies

1.5.8.RELEASE

Pom

Import

Org.springframework.boot

Spring-boot-starter

How to start the entry of spring boot

Package com.zcp.springstart

Import org.springframework.boot.SpringApplication

Import org.springframework.boot.autoconfigure.SpringBootApplication

Import org.springframework.context.ConfigurableApplicationContext

Import org.springframework.context.annotation.Bean

@ SpringBootApplication

Public class App {

@ Bean

Public Runnable createRunnable () {

Return new Runnable () {

@ Override

Public void run () {

System.out.println ("> runn-")

}

}

}

Public static void main (String [] args) {

ConfigurableApplicationContext context = SpringApplication.run (App.class, args)

Context.getBean (Runnable.class) .run ()

}

}

Description: the startup entry class of springboot defaults to the configuration class, so you can inject bean into this class.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report