Spring-- Eclipse下搭建SpringBoot项目

Eclipse下搭建SpringBoot项目

环境准备

eclipse下载和jdk配置就不赘述了

打开eclipse———>Help——>Eclipse Marketplace wizard
搜索STS 下载这个 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
在这里插入图片描述
一路next等待下载安装完毕
进度会在这里
还是比较慢 得等一会
在这里插入图片描述

新建Springboot项目

选这个
在这里插入图片描述
下面自己设置;java 8就是jdk 1.8
在这里插入图片描述
Web项目基本就选这些;看自己需求添加即可 ——>Finish
在这里插入图片描述
然后配置application.properties文件;pom.xml文件基本不用动
在这里插入图片描述
application.properties配置↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

server.port=9090
#端口自己定
# mysql jdbc配置
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#mysql-connector-java 6要改成com.mysql.cj.jdbc.Driver
##根据自己数据库信息更改
spring.datasource.url=jdbc:mysql://localhost:3306/db_sal?characterEncoding=utf8&useSSL=false
spring.datasource.username=root
spring.datasource.password=12345

启动项目

写个简单Controller
在这里插入图片描述

package com.one.shop.controller;

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


@RestController
public class TestController {

    @RequestMapping("/hello")
    public String Test() {
        return " qwq  boot";
    }
}

右键项目Run as——>Spring Boot App
在这里插入图片描述
项目启动成功;
在这里插入图片描述
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值