安装jdk
安装maven
安装vscode
安装vscode插件
- Extension Pack for Java
- Spring Boot Extension Pack
- Lombok Annotations Support for VS Code
- Language Support for Java™ by Red Hat
jdk和maven配置
{
"workbench.colorTheme": "One Dark Pro",
"redhat.telemetry.enabled": true,
"java.errors.incompleteClasspath.severity": "ignore",
"java.jdt.ls.java.home":"E:/Java/jdk-17.0.6",
"java.configuration.maven.userSettings": "E:/Java/apache-maven-3.9.0/conf/settings.xml",
"maven.executable.path": "E:/Java/apache-maven-3.9.0/bin/mvn.cmd",
"maven.terminal.useJavaHome": true,
"maven.terminal.customEnv": [
{
"environmentVariable": "JAVA_HOME",
"value": "E:/Java/jdk-17.0.6"
}
],
}
创建maven项目
ctrl+shift+p 打开搜索 spring 并选择 Create a Maven Project
选择 spring boot 版本
选择开发语言
设置groupid
选择打包类型
选择java版本
根据需要选择依赖
选择存放路径
项目结构如下: