使用Eclipse 建立 搭建SpringBoot项目

以前用IDEA 建立Springboot 项目感受十分简单,可是经常使用的毕竟是Eclipse  因此开一个帖子记录一下Eclipse 如何建立 Springboot 项目java

 

第一步:Help -> Eclipse Marketplace…web

在search 中输入 'STS' spring

install 便可!springboot

第二部:new -> project -> other -> Spring start project;app

 

 点击finsh   SpringBoot 项目建立完成  ,下面写一个测试demo测试

 

 

package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); System.out.println( " ----------------------------------------    "); System.out.println( " ----------------------------------------    "); System.out.println( " ----------------------------------------    "); System.out.println("SPRINGBOOT SUCCESS!!"); System.out.println( " ----------------------------------------    "); System.out.println( " ----------------------------------------    "); System.out.println( " ----------------------------------------    "); } }

 

建立一个helloController.javathis

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;spa

@RestController
public class helloController {3d

@RequestMapping("/hello")
public String test(){
return "hello,this is a springboot demo";
}
}code

 

 

 

运行run   

 

相关文章
相关标签/搜索