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 小时前
idea怎么打开两个窗口,运行两个项目
java·ide·intellij-idea
HoneyMoose2 小时前
IDEA 2024.3 版本更新主要功能介绍
java·ide·intellij-idea
PigeonGuan4 小时前
【jupyter】linux服务器怎么使用jupyter
linux·ide·jupyter
小狮子安度因5 小时前
PyQt的安装和再PyCharm中的配置
ide·pycharm·pyqt
VernonJsn8 小时前
visual studio 2005的MFC各种线程函数之间的调用关系
ide·mfc·visual studio
戎梓漩8 小时前
windows下安装curl,并集成到visual studio
ide·windows·visual studio
nbsaas-boot10 小时前
如何利用ChatGPT加速开发与学习:以BPMN编辑器为例
学习·chatgpt·编辑器
一棵开花的树,枝芽无限靠近你11 小时前
【PPTist】添加PPT模版
前端·学习·编辑器·html
热爱生活的五柒12 小时前
vscode利用ofExtensions插件可以调试单进程Openfoam,但是不能调试mpi多进程案例
ide·vscode·编辑器
小陈phd12 小时前
Vscode LinuxC++环境配置
linux·c++·vscode