javavscode icon indicating copy to clipboard operation
javavscode copied to clipboard

Java 8 project , Lsp server not using jdk.project.jdkhome bu

Open exetroncorp opened this issue 7 months ago • 4 comments

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"
}

Image

Tested java 8 project :

simple-java-8.zip

exetroncorp avatar Apr 29 '25 11:04 exetroncorp

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. Image

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.

sid-srini avatar Apr 29 '25 14:04 sid-srini

Hello @sid-srini ,

Thanx for your response.

With the same settings.json It works with your example file , that means paths are correct.

Image

I am on a debian 12 pod and version of plugin is 24.0.0

exetroncorp avatar Apr 29 '25 17:04 exetroncorp

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.

sid-srini avatar Apr 30 '25 06:04 sid-srini

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.

exetroncorp avatar Apr 30 '25 08:04 exetroncorp