VSCode 配置Java环境

闲话少说,开始配置挚爱的 VSCode!!!

第一步,安装VScode小插件

第二步,简单写个测试代码

然后进入 setting.json 替换以下代码

第三步,配置 launch.json

好了,到此完成,希望能帮到大家!!!有问题可以留言共同探讨哦!!!

[点击这里转到Wondows配置java环境,配置完之后再到这个文章看VSCode配置](https://blog.csdn.net/weixin_43529904/article/details/88370720)

闲话少说,开始配置挚爱的 VSCode!!!

第一步,安装VScode小插件

我装了三个,因为写Java更方便,第一个必须装

f92a35445653b9e061d516e96abb3830.png349e8f89e5e7938e857b7ae0c5e963e5.pnge17725bb6f9a487c6b2b571a3c09b383.png

第二步,简单写个测试代码

class first {

public static void main(String[] args) {

System.out.println("Hello");

}

}

然后进入 setting.json 替换以下代码

记住:路径一定要修改成电脑 JDK 安装路径,具体安装方法,点击这里

setting.json 打开方式:

8acca882914dbbff26577f203cddf80b.png

0abff5c67cd5ee160a019d9d6dd21178.png

{

"terminal.integrated.shell.windows": "C:\\\\Windows\\\\System32\\\\cmd.exe",

"files.autoSave": "afterDelay",

"editor.fontSize": 16,

"explorer.confirmDelete": false,

"window.zoomLevel": 0,

"editor.formatOnSave": true,

"vetur.format.defaultFormatter.html": "js-beautify-html",

"workbench.statusBar.visible": true,

"workbench.activityBar.visible": true,

"window.menuBarVisibility": "default",

"workbench.sideBar.location": "left",

"cmake.configureOnOpen": true,

"explorer.confirmDragAndDrop": false,

"java.jdt.ls.vmargs": "-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -javaagent:\"C:\\Users\\wmy\\.vscode\\extensions\\gabrielbb.vscode-lombok-0.9.7/server/lombok.jar\" -Xbootclasspath/a:\"C:\\Users\\wmy\\.vscode\\extensions\\gabrielbb.vscode-lombok-0.9.7/server/lombok.jar\"",

"java.configuration.maven.userSettings": "E:/apache-maven-3.6.0/conf/settings.xml",

"java.home": "C:/Program Files/Java/jdk1.8.0_201",

"maven.executable.path": "E:/apache-maven-3.6.0/bin/mvn",

"maven.terminal.customEnv": [

{

"environmentVariable": "JAVA_HOME",

"value": "C:/Program Files/Java/jdk1.8.0_201"

}

],

"editor.suggestSelection": "first",

"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue"

}

第三步,配置 launch.json

launch.json 打开方式:

1e661a5f67c4f3714a946d4197565dc3.png

{

"configurations": [

{

"type": "java",

"name": "CodeLens (Launch) - first",

"request": "launch",

"console": "externalTerminal", //没有这句话,vscode配置之后 console不能输入

"mainClass": "first"

}

]

}

好了,到此完成,希望能帮到大家!!!有问题可以留言共同探讨哦!!!

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐