Home > OS >  VSCode Java 17 cannot find projects
VSCode Java 17 cannot find projects

Time:08-25

After I upgraded to Java 17 (from 11), VSCode, with the java enter image description here

It is a maven project, with a pom file in the root folder and then multiple projects below, like the three shown in the picture above.

It recognizes the maven part just fine, but no java projects.

I tried:

  • Setting the JAVA_HOME variable
  • Setting the "java.jdt.ls.java.home"
  • Setting a config in "java.configuration.runtimes"

What can I do to make VSCode recognize my java projects?

CodePudding user response:

Possible workarounds

Add the following configuration to the settings.json file

    "java.jdt.ls.vmargs": "-Xlog:jni resolve=off",

CodePudding user response:

Setting the the maven.userSettings in settings.json did the trick!

"java.configuration.maven.userSettings": ".mvn/settings.xml",

For some reason this wasn't needed when I used Java 11, but now with Java 17 it apparently doesn't find it automatically.

EDIT: My mistake, it can find it, I was missing the settings file in my .m2 folder, after putting it there, I don't need to set the path as above.

So yea, either put the settings file in the home/.m2 folder or set the java.configuration.maven.userSettings

  • Related