大家好,又见面了,我是你们的朋友全栈君。
VSCode 配置Java环境
[点击这里转到Wondows配置java环境,配置完之后再到这个文章看VSCode配置](https://blog.csdn.net/weixin_43529904/article/details/88370720)
闲话少说,开始配置挚爱的 VSCode!!!
第一步,安装VScode小插件
我装了三个,因为写Java更方便,第一个必须装
第二步,简单写个测试代码
class first {
public static void main(String[] args) {
System.out.println("Hello");
}
}
然后进入 setting.json 替换以下代码
记住:路径一定要修改成电脑 JDK 安装路径,具体安装方法,点击这里
setting.json 打开方式:
{
"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 打开方式:
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - first",
"request": "launch",
"console": "externalTerminal", //没有这句话,vscode配置之后 console不能输入
"mainClass": "first"
}
]
}
好了,到此完成,希望能帮到大家!!!有问题可以留言共同探讨哦!!!
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/142734.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...