如何切换VScode里面的java版本
如何切换VScode里面的java版本打开setting.json添加java.home配置即可
·
如何切换VScode里面的java版本
最近用VScode打开新版本的java代码,发现无法通过编译,这是因为Vscode里面是旧版本的java。
打开settings.json
打开设置,点击扩展,然后点击Java Test Runner,然后点击在settings.json中编辑
配置java.home
然后在最后一行添加java.home配置即可:

{
"editor.wordWrap": "on",
"workbench.iconTheme": "vs-minimal",
"explorer.confirmDelete": false,
"files.encoding": "utf8",
"window.zoomLevel": 0,
"editor.suggestSelection": "first",
"files.autoGuessEncoding": true,
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"files.associations": {
"*.java": "java"
},
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"terminal.integrated.inheritEnv": false,
"workbench.startupEditor": "newUntitledFile",
"[css]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"terminal.integrated.rendererType": "dom",
"java.configuration.checkProjectSettingsExclusions": false,
"[java]": {},
"java.errors.incompleteClasspath.severity": "ignore",
"java.home": "E:\\java\\java9\\jdk-9",
}
重启VScode
最后重启VScode即可.
更多推荐



所有评论(0)