vscode搭建java开发环境

   一、配置extensions环境变量VSCODE_EXTENSIONS

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

    二、setting配置文件

{
    "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项目启动配置Lanunch.json

{
 
    "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"
            }
        }
    ]
}

四、必备插件

vscode搭建java开发环境_第1张图片

五、vscode用户数据区迁出系统盘

      随着ide的长时间使用,会产生大量的用户数据,cscode用户数据默认存储在c盘下,这样会造成系统盘暴增,可以采用软链接的方式,将用户数据挂载到其他的非系统盘

mklink /D "%APPDATA%\Code" "E:\usr\data\AppData\Roaming\Code"

你可能感兴趣的:(vscode,ide,编辑器)