背景
因实际的编程环境是jdk1.6,vscode安装了spring boot tools开发后,application.properties无法提示。spring boot tools的功能之一就是提示application.properties,所以问题就在于spring boot tools加载出了问题。
编程环境
系统环境变量JAVA_HOME是1.6,但setting.json配置了java.home是1.8
"java.configuration.maven.userSettings": "D:\\My\\tools\\maven\\conf\\settings.xml",
"maven.executable.path": "D:\\My\\tools\\maven\\bin\\mvn.cmd",
"maven.terminal.customEnv": [
{
"environmentVariable": "JAVA_HOME",
"value": "D:\\work\\OpenJdk\\8"
}
],
spring boot tools 因系统的环境变量JAVA_HOME是1.6,报错
Error trying to find JVM: Unexpected output from `java -XshowSettings:properties`. Didn't find all expected properties: java.version,java.home
解决方式
系统环境变量JAVA_HOME配置1.8及以上
如果因实际需要,不能修改系统环境变量。首选项->设置->修改setting
"spring-boot.ls.java.home": "D:\\work\\OpenJdk\\8"
-
编辑器的文件格式选择 "spring boot properties"