- 首先下载Spring支持插件
- 右键新建工程,找到spring boot,双击
- 选择springboot版本,2.0.2然后选择web
- 点击完成
- 等待创建.目录结构如下
- package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class SpringBootDemo2Application {
@RequestMapping("/")
String home() {
return "hello World";
}
public static void main(String[] args) {
SpringApplication.run(SpringBootDemo2Application.class, args);
}
} - 运行
- 访问localhost:8080/
Eclipse创建SpringBoot工程
猜你喜欢
转载自blog.csdn.net/ethan__xu/article/details/80546652
今日推荐
周排行