vscode搭建java开发环境

一、配置extensions环境变量VSCODE_EXTENSIONS,

该环境变量路径下的存放安装组件:

二、setting配置文件

html 复制代码
{
    "java.jdt.ls.java.home": "e:\\software\\jdk\\jdk17",
     // java运行环境
    "java.configuration.runtimes": [
        {
            "name": "JavaSE-1.8",
            "path": "e:\\software\\jdk\\jdk8\\jdk",
        },
        {
            "name": "JavaSE-17",
            "path": "e:\\software\\jdk\\jdk17",
        },
    ],
    // maven配置
    "java.configuration.maven.userSettings": "e:\\software\\maven3.8.1\\conf\\settings.xml",
    "maven.settingsFile": "e:\\software\\maven3.8.1\\conf\\settings.xml",
    "maven.executable.path": "e:\\software\\maven3.8.1\\bin\\mvn.cmd",
    "maven.terminal.useJavaHome": true,
    "maven.terminal.customEnv": [
        {
            "environmentVariable": "JAVA_HOME",
            "value": "e:\\software\\jdk\\jdk8\\jdk"
        }
    ],

    // gradle配置
    "java.import.gradle.home": "E:\\software\\gradle\\gradle-7.3",
    "java.import.gradle.user.home": "E:\\software\\gradle\\repo",
    //  git配置
    "git.path": "e:\\software\\git\\bin\\git.exe",
    "git.enableSmartCommit": true,
    "update.mode": "none",
    "terminal.integrated.profiles.windows": {
        "PowerShell -NoProfile": {
            "source": "PowerShell",
            "args": [
                "-NoProfile"
            ]
        },
        "Git-Bash": {
            "path": "e:\\software\\git\\bin\\bash.exe",
            "args": []
        }
    },
    "git.autofetch": true,
    // 终端控制台输出颜色配置
    "workbench.colorCustomizations": {
        "terminal.background": "#181818",
        "terminal.foreground": "#26e045",
        "terminalCursor.background": "#D8D8D8",
        "terminalCursor.foreground": "#D8D8D8",
        "terminal.ansiBlack": "#181818",
        "terminal.ansiBlue": "#7CAFC2",
        "terminal.ansiBrightBlack": "#585858",
        "terminal.ansiBrightBlue": "#7CAFC2",
        "terminal.ansiBrightCyan": "#86C1B9",
        "terminal.ansiBrightGreen": "#A1B56C",
        "terminal.ansiBrightMagenta": "#BA8BAF",
        "terminal.ansiBrightRed": "#AB4642",
        "terminal.ansiBrightWhite": "#F8F8F8",
        "terminal.ansiBrightYellow": "#F7CA88",
        "terminal.ansiCyan": "#86C1B9",
        "terminal.ansiGreen": "#A1B56C",
        "terminal.ansiMagenta": "#BA8BAF",
        "terminal.ansiRed": "#AB4642",
        "terminal.ansiWhite": "#D8D8D8",
        "terminal.ansiYellow": "#F7CA88",
        "terminal.integrated.cursorBlinking": true,
        "terminal.integrated.lineHeight": 1.6,
        "terminal.integrated.letterSpacing": 0.1,
        "terminal.integrated.fontSize": 25,
        "terminal.integrated.fontFamily": "Lucida Console",
        "terminal.integrated.shell.linux": "/bin/zsh",
    },
    "editor.fontSize": 15,
    "editor.showUnused": true,
    "editor.codeActionsOnSave": {
        "source.fixAll": true
    },
    "window.zoomLevel": 1.2,
    "workbench.editor.autoLockGroups": {
        "decompiled.javaClass": true
    },

}

三、SprignBoot项目启动配置

html 复制代码
{
 
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "App",
            "request": "launch",
            "mainClass": "com.fcw.App",
            "projectName": "app",
            "vmArgs": "-Xmx256m -Xms256m ",
            "env": {
                "SPRING_PROFILES_ACTIVE": "dev",
                "JAVA_HOME": "E:\\software\\jdk\\jdk8\\jdk"
            }
        }
    ]
}

四、必备插件

相关推荐
莲动渔舟1 小时前
妙用编辑器:如何使用编辑器的筛选功能更高效的阅读日志
编辑器
神洛华1 小时前
Y3编辑器教程8:资源管理器与存档、防作弊设置
编辑器·游戏引擎·游戏程序
码上好玩1 小时前
vscode写python,遇到问题:ModuleNotFoundError: No module named ‘pillow‘(已解决 避坑)
vscode·python·pillow
界面开发小八哥2 小时前
「Java EE开发指南」如何用MyEclipse构建一个Web项目?(一)
java·前端·ide·java-ee·myeclipse
scoone3 小时前
VSCode 性能优化指南:提高编码效率,减少资源占用
ide·vscode·编辑器
搞笑的秀儿4 小时前
12.25 VScode+jupyter使用
ide·vscode·jupyter
html组态4 小时前
web组态可视化编辑器
前端·物联网·编辑器·web组态·组态·组态软件
码农老起4 小时前
IntelliJ IDEA 基本使用教程及Spring Boot项目搭建实战
java·ide·intellij-idea
温柔的男孩像海洋丶5 小时前
vscode的keil assistant 中搜索不到全局变量
ide·vscode·单片机
WebCandy6 小时前
Github Copilot:已免费,速回归!!!
编辑器·github·copilot·ai编程