JDTLS' code action/completion suggests really out of place things
I'm trying to use Neovim whenever I can, partly to learn it and partly because I just prefer it (when it works). One big annoying problem I run into constantly is the suggestions sometimes just breaks and suggests things like
Listfrom org.hibernate instead of java.util.
The fix is rather simple, just relaunch Neovim (just restarting the LSP sometimes works, but faster and more reliable to just quit it completely), but when I work on something new I may not notice that it happened again and I assume the autofill is correct.
From what I've seen, other people have had similar experience with JDTLS on other editors so I don't think this is an LSP/neovim config problem (since it does work nicely otherwise, even better than intellij in some rare cases). None of the fixes I've seen (change jdk version, deleting JDTLS cache, etc.) works. I also tried using some Java-specific plugins for neovim but saw no or worse effect.

11 Replies
⌛ This post has been reserved for your question.
Hey @aquaduck97! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
I think you can configure type filters that prevent some types from being shown (at least that's possible with JDT)?
Also are there any logs?
I get this a bunch:
java.io.FileNotFoundException: /home/tux/.cache/jdtls/workspace/.metadata/.plugins/org.eclipse.jdt.core/2534747095.index
(part of the same error)
And then this:
that is when it starts I think
and the
WARNING: Using incubator modules: jdk.incubator.vector is probably because of the --add-modules=ALL_SYSTEM or something like that but it shouldn't cause issues normally
Does that happen when you call the content assist which misses java.util.List or does it happen on startup?
that error is likely related to the issueIt's seemingly random, it's with both the completion as I type and the code actions popup.
I haven't found any way to replicate it, it just happens
Does renaming the .metadata directory change anything?
I would rather rename it rather than deleting it just in case ;)
Note: This may get rid of your settings
Maybe it loads faster now ( could sometimes take a few seconds to load, though that also seemed random)
Completion is there so nothing broke what I can see at least
Did it recreate the .index files?
Yep

I cleared the lsp.log file and hopped in a java file and made a change and got some clearer view of the errors.
Couldn't find a paste service that either didn't cost money, didn't require an account or blocked random words though so this was the best I could find, bit annoying to use tbh:
https://voidbin.com/paste/247b4ce5-d54f-42c8-bb8d-993a0ce1bce9
Untitled Paste
[START][2025-09-02 16:59:46] LSP logging initiated
[ERROR][2025-09-02 16:59:46] ...p/_transport.lua:36 "rpc" "jdtls" "stderr" "WARNING: Using incubato
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.