You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to integrate the nvim-java plugin in my nvim config.
Before that I tried also to make it work with nvim-jdtls
The result is almost the same though I do prefer the nvim java plugin because it is much cleaner.
Outside from some exception I could not get the lsp references and definition to work.
Not even the telescope plugin with its search capabilities while it works for other lsp f.e Vtls for javascript or for go
I also tried the lean version from the devcontainer image without any other package installed and still could not get it to work at its full potential.
Let me know If I can provide more information about it because I really want to work with nvim instead of other IDEs.
Steps To Reproduce
Try to add the root markers in the jdtls to initiate it,
Check if the lsp references or the telescope works.
Check if the Java commands work
Expected Behavior
No editor command Lsp References or no references found.
Java commands do not work.
That means that the lsp gets deattached.
I tried it. Cleaned and rebuilt the workspace. Still cannot get lsp references to work or daclarations nor the telescope functionality. Message I get back is no references found although I can check with grep that there are other files with that word!!
Hey, it's not the place to seek support in the issue, please delete your comment there and open a discussion and I'll try to help you as much as I can.
Hey, it's not the place to seek support in the issue, please delete your comment there and open a discussion and I'll try to help you as much as I can.
Accidentally I posted the config on the other side.
Still tried the solution at the 384 but could not get it to work.
Any suggestions?
One suggestion is to see the kickstart starter project and try to set it up the same way.
The other is to upload your .config/nvim and a sample project in your repo and I'll see what I can do.
There are other files as well but I don't think they are essential for your case. Go To Definition and LSP References work, at least inside the project itself.
However it didn't start installing and running the language servers out of the box, I had re restart a few times, start neovim inside a java project and open a java file, things like that. Then it cycled through versions of one and the same thing several times. Once it stops opening mason and installing stuff on its own, don't update the related mason packages(jdtls, spring-boot-tools, java-*), although update availability is indicated. Nvim-java seem to be fragile and requires specific versions from its own mason registry.
I implemented the changes.
Results were no references found
Or no LSP found.
Java language server spins up.
I will try to implicit the java version.
I will double try to restart a couple of times nvim to see if it starts properly!
Hi, I'm having a problem that I can go to definition for methods defined in the project but can't go to the definition of the methods from external dependencies. Is this the same with the issue raised in this one? Thanks!
I don't think it's the same problem. If by external dependencies you mean jar files, then this needs additional implementation which utilizes decompiler. If you have multi module project, then I have implemented changes to integrate project.nvin in my repo which when nvim is opened inside the top most directory will find definitions across modules.
Yeah, for example if I want to go to the source code of the interface UserDetails( import org.springframework.security.core.userdetails.UserDetails;), does the current state of this plugin support that feature?
Yeah, for example if I want to go to the source code of the interface UserDetails( import org.springframework.security.core.userdetails.UserDetails;), does the current state of this plugin support that feature?
then this needs additional implementation which utilizes decompiler.
Activity
logrusx commentedon Jul 1, 2025
See the last comment in #284
IoannisLafiotis commentedon Jul 1, 2025
I tried it. Cleaned and rebuilt the workspace. Still cannot get lsp references to work or daclarations nor the telescope functionality. Message I get back is no references found although I can check with grep that there are other files with that word!!
logrusx commentedon Jul 1, 2025
It's actuary #384, sorry about that
logrusx commentedon Jul 2, 2025
Hey, it's not the place to seek support in the issue, please delete your comment there and open a discussion and I'll try to help you as much as I can.
IoannisLafiotis commentedon Jul 2, 2025
Accidentally I posted the config on the other side.
Still tried the solution at the 384 but could not get it to work.
Any suggestions?
logrusx commentedon Jul 3, 2025
One suggestion is to see the kickstart starter project and try to set it up the same way.
The other is to upload your .config/nvim and a sample project in your repo and I'll see what I can do.
IoannisLafiotis commentedon Jul 4, 2025
I have right now the latest mason versions from V1. Maybe you could share the working version from your side?
logrusx commentedon Jul 5, 2025
Earlier I wrote another replay but then figured out my mistake and I deleted it. If you got the contents with the email notification, disregard it.
This is my working configuration:
https://gist.github.com/logrusx/ff0b7c600278fa96eed5208a6ffa63f2
There are other files as well but I don't think they are essential for your case. Go To Definition and LSP References work, at least inside the project itself.
However it didn't start installing and running the language servers out of the box, I had re restart a few times, start neovim inside a java project and open a java file, things like that. Then it cycled through versions of one and the same thing several times. Once it stops opening mason and installing stuff on its own, don't update the related mason packages(jdtls, spring-boot-tools, java-*), although update availability is indicated. Nvim-java seem to be fragile and requires specific versions from its own mason registry.
IoannisLafiotis commentedon Jul 5, 2025
I implemented the changes.
Results were no references found
Or no LSP found.
Java language server spins up.
I will try to implicit the java version.
I will double try to restart a couple of times nvim to see if it starts properly!
logrusx commentedon Jul 5, 2025
Can you create a project from scratch, put a few classes and confirm if this is project setup related issue?
logrusx commentedon Aug 6, 2025
I believe this is either a configuration issue or it should be fixed with #384 (or combination of both)
logrusx commentedon Aug 8, 2025
Hello @IoannisLafiotis, after taking a look at your configuration, I believe this is a duplicate of #293
pndesu commentedon Aug 29, 2025
Hi, I'm having a problem that I can go to definition for methods defined in the project but can't go to the definition of the methods from external dependencies. Is this the same with the issue raised in this one? Thanks!
logrusx commentedon Aug 29, 2025
I don't think it's the same problem. If by external dependencies you mean jar files, then this needs additional implementation which utilizes decompiler. If you have multi module project, then I have implemented changes to integrate project.nvin in my repo which when nvim is opened inside the top most directory will find definitions across modules.
pndesu commentedon Sep 2, 2025
Yeah, for example if I want to go to the source code of the interface UserDetails( import org.springframework.security.core.userdetails.UserDetails;), does the current state of this plugin support that feature?
logrusx commentedon Sep 2, 2025
Which means no.
logrusx commentedon Sep 6, 2025
@pndesu actually it turns out you can configure jdtls to download sources.
Here's what I took from a nvim-jdtls configuration I found out there which did that:
Setup nvim-java with this, I think it's enough to make it work.
s1n7ax commentedon Nov 30, 2025
Hi try switching to v4.0.0 branch. This issue is not present in there.
https://github.com/nvim-java/nvim-java/tree/v4.0.0