需Eclipse IDE for Java Developers
Help–Eclipse Marketplace–在Find搜索spring下载spring tools 4
File–New–Project–Spring Boot–Spring Starter Project项目创建
需等待完成:
①编写配置文件pom.xml
②
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello(String name) {
return "hello world,"+name;
}
}
③启动主程序
右键单击项⽬中的Run As命令,就可启动项⽬了,若出现以下内容表示启动成功