开发环境配置

1.安装MySQL

参考教程:MySQL 8.0下载、安装及配置教程

出现问题:之前安装过MySQL但未删除干净,需要在目录中搜索mysql,将相关文件全部删除,然后再安装

2.安装Redis

参考教程:Windows环境Redis安装配置

安装Redis的可视化程序:Redis Desktop Manager

参考教程:Redis_Desktop_Manager工具使用

3.配置SpringBoot环境

①安装并配置maven

参考教程:Maven简介以及安装教程

②在IDEA中配置SpringBoot环境

参考教程:

IDEA配置SpringBoot环境

Spring Boot入门搭建及环境配置

出现问题:

①报错:Java: 错误: 无效的源发行版:17

解决方式:[JAVA] java: 错误: 无效的源发行版:17

②报错:java: 无法访问org.springframework.boot.SpringApplication

解决方式:java: 无法访问org.springframework.boot.SpringApplication解决办法

③报错:找不到插件 ‘org.springframework.boot:spring-boot-maven-plugin:‘

解决方式:解决:找不到插件 ‘org.springframework.boot:spring-boot-maven-plugin:‘问题

解决上述问题后,运行代码成功显示出Spring图像  

复制教程中的demo进行测试

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}
	@GetMapping("/hello")
	public String Hello(){
		return "Hello World!";
	}
}

 出现问题:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-12-19 15:30:53.929 ERROR 26476 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Web server failed to start. Port 6379 was already in use.

Action:

Identify and stop the process that's listening on port 6379 or configure this application to listen on another port.

解决方式:可以描述中是因为6379端口被占用,在application.properties中修改一个空闲的端口8000

参考:Identify and stop the process that’s listening on port 8080 or configure this application to listen

可以看到已经没有报错了

4.安装Postman接口测试工具

官网下载:Postman

使用教程:Postman(接口测试工具) 怎么测controller层数据

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值