javavscode
javavscode copied to clipboard
Java 8 project , Lsp server not using jdk.project.jdkhome bu
Error in Java 8 project: LSP server using 'jdkHome' parameter instead of the correct 'jdk.project.jdkhome', causing incorrect linter errors
settings.json
{
"jdk.project.jdkhome": "/home/codespace/java/8.0.452-tem/",
"jdk.jdkhome": "/home/codespace/java/21.0.6-oracle"
}
Tested java 8 project :
Hi @exetroncorp. Thank you for reaching out to us. Please let us know which version of the extension is in use here.
Please find below a screenshot of a simple file with the specific annotation that you have referred to in your example where no errors are reported by the linter and even auto-completion is performed for these Java8 annotations due to jdk 8 used in the project.
In your environment, do check that the path value given for jdk.project.jdkhome in the workspace settings is correct and points to the directory that contains the JDK's directories such as bin/, lib/, jre/ etc. On MacOS, this may mean a path like /Users/code/jdk-8/Contents/Home.
You may also check after Reloading the window or/and Delete the extension cache for the workspace (using the VS Code command).
Please let us know if this helped. Thanks.
Hello @sid-srini ,
Thanx for your response.
With the same settings.json It works with your example file , that means paths are correct.
I am on a debian 12 pod and version of plugin is 24.0.0
Thanks for checking that the project jdkhome path in settings is fine.
It maybe possible that there was some state corruption in the earlier workspace. Please try once after Deleting the workspace extension cache and reloading the window. You may refer to the Troubleshooting section of our guide for steps to delete the cache.
Let us know if that helps.
Hi,
Already delete oracle extension cache through palette and deleted folder ,change folder ,reload. Can you try the project zipped in the issue?its a basic project.