5

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?

1
  • 1
    you must use java.jdt.ls.java.home instead of java.home since its deprecated this setting might be removed in later version of VS Code. Commented Mar 8, 2022 at 12:18

1 Answer 1

8

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.


However, 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, first read https://stackoverflow.com/questions/71042056/. Downloading a new JDK (as suggested by VSCode) may not be the best solution.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.