Home > Net >  VS code & java: This setting is deprecated, please use 'java.jdt.ls.java.home' instead
VS code & java: This setting is deprecated, please use 'java.jdt.ls.java.home' instead

Time:03-09

I faced this error when I was trying to set up Java in my vs code. In my settings.json:

"java.home": "C:\\Program Files\\Java\\jdk-17.0.22"

but the error says This setting is deprecated, please use 'java.jdt.ls.java.home' instead. What is wrong here?

CodePudding user response:

What is wrong here?

You are using a setting name that has been deprecated. This setting is still probably still going to work ... for now ... but it is likely that it will stop working completely in a future release.

So what you need to do is to change your "settings.xml" to use "java.jdt.ls.java.home" as the property name instead of "java.home". It would be advisable to do this as soon as practical.


Note that there is more information on the VSCode for Java settings here. The current version of the page says this:

java.home : Deprecated, please use 'java.jdt.ls.java.home' instead. Absolute path to JDK home folder used to launch the Java Language Server. Requires VS Code restart.


If your real problem is that VSCode is telling you that your version of the Java JDK is incompatible and you need to download a new one ... see Java on VSCode Extension Pack for Java can't detect jdk ... because downloading a JDK may not be the best solution.

  • Related