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

四、必备插件

相关推荐
栈溢出了2 小时前
pycharm 有智能提示,但是没法自动导包,也就是alt+enter无效果
ide·python·pycharm
╰つ゛木槿3 小时前
使用VSCode编写C#程序
ide·vscode·c#
musk12124 小时前
vim 中快速删除引号中的字符串
linux·编辑器·vim
GuokLiu6 小时前
250405-VSCode编辑launch.json实现Debug调试Open-WebUI
vscode·debug·open-webui
花花鱼8 小时前
vscode中的【粘滞滚动】的基本概念和作用,关闭了以后如何开启
ide·vscode·编辑器
wang_peng9 小时前
android studio 基础
android·ide·android studio
blakeyi9 小时前
vscode保存自动刷新cocos creator编辑器
ide·vscode·cocos creator·热更新
点云SLAM10 小时前
MD编辑器中的段落缩进怎么操作
编辑器·markdown·md编辑器·空格操作·css编辑器
莫魂魂10 小时前
002_IDEA企业开发工具
java·ide·intellij-idea
周博洋K11 小时前
VScode 玩 MCP的server
ide·vscode·编辑器