现在比较新的版本的VS Code的已经必须配置JDK11版本及其以上的才能运行了,但是现在绝大多数开发用的还是JDK1.8,因此这里记录一下VS Code配置java开发环境。
可以先到Extensions
插件那里去搜索Java
关键字
下载好插件以后,按Ctrl + Shift + p
打开settings.json
然后配置"java.home"和"java.configuration.runtimes",如下格式
{ "workbench.colorTheme": "Visual Studio Dark - C++", "editor.mouseWheelZoom": true, "editor.fontSize": 18, "java.home": "D:\\Java11\\jdk-11.0.12", "java.configuration.runtimes": [ { "name": "JavaSE-1.8", "path": "D:\\Java\\jdk" }, { "name": "JavaSE-11", "path": "D:\\Java11\\jdk-11.0.12", "default": true }, { "name": "JavaSE-16", "path": "D:\\Java16\\jdk-16.0.2" } ], "editor.suggestSelection": "first", "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", "files.exclude": { "**/.classpath": true, "**/.project": true, "**/.settings": true, "**/.factorypath": true } }