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
hey,
idk if it's related but in case, regarding this issue mason-org/mason.nvim#1939 (comment) which origin is from several occurence of a declaration of a mason.setup().
From my understanding, setting require("java").setup() also set a require("mason").setup() under the hood. However calling opts in mason plugin declaration (for instance to configure the mason nvim-java registry) also triggers a require("mason").setup() which leads to the aforementionned issue
This issue should be a big warning at the top of the Readme.
I thought that I messed up load orders or something, but no, it's this.
Fixing mason to v1 fixed it for me though, it would be cool if something like this is in the readme, because that's where people look first when configuring a plugin.
Reacted by Fernando, Sebastian Reck, Rajat Kumar, Slava.In, mattys, Eduardo Tinta, Skydeke, Etienne Théodore, Ralph Sanders, Mateusz Bednarski and 1 more
for some reason get_installed_version kept popping up in different place
I've locally fixed all Mason API calls, including in nvim-java-core and it still doesn't work. It seems it isn't only that.
Only pinning mason and mason-lspconfig to v1 works. However the following is not entirely complete:
So for me that workaround solved the issue:
* Pinning Mason and Mason LSP versions to ^1 as suggested by [@s1n7ax](https://github.com/s1n7ax)
* Removing `lazy-lock.json` file
* Removing `/home/{user}/.local/share/nvim/lazy`
* Reinstalling plugins
If you already have packages installed with Mason v2, then you need to purge /home/{user}/.local/share/nvim/mason as well. The easiest would be to purge the entire /home/{user}/.local/share/nvim directory. The worst that could happen is a few hundred of megabytes extra download.
Migration is complete in my repo along with some fixes. Go check it out. Check the branches and the discussion for details. Skip the earlier comments and see the last few.
@s1n7ax I've created 2 PR's in nvim-java and nvim-java-core along with one in starter-kickstart that should move nvim-java to Mason 2.0 compatibility.
To keep nvim-java running on Mason 2.0 at its current state, fixes are necessary in the custom mason registry. I'm not interested in using it so I haven't fixed it. Also I found it hard to find documentation what and if I need to change something related to Mason 2.0. I think it might be as simple as just fixing the download URL's. I'm leaving this job for you.
I've also modified nvim-java and nvim-java-core to use the official mason repository only. I'm not creating PR's for it because I don't know if you would be willing to merge it. You can review the changes in my repo and if you want, I'll prepare PR's for you or you can do it yourself.
Another modification I've made is to be able to use latest versions of everything by passing * for the version.
Let me know if you need something from my side.
p.s. Thank you very much for the effort you've put to put nvim-java together.
@s1n7ax I need issue #403 closed to spare you resolving conflicts. PR #405 is linked and resolves it. Could you please also look at #406. It would be nice to have that closed too.
Merged. Now you should be able to use Mason 1.0 as well as Mason 2.0. @logrusx Thanks for the hard work. Hope we can see more contributions in the future from Java devs as I'm no longer a Java dev nor hoping to contribute to this.
Activity
ginolegigot commentedon May 17, 2025
hey,
idk if it's related but in case, regarding this issue mason-org/mason.nvim#1939 (comment) which origin is from several occurence of a declaration of a mason.setup().
From my understanding, setting require("java").setup() also set a require("mason").setup() under the hood. However calling opts in mason plugin declaration (for instance to configure the mason nvim-java registry) also triggers a require("mason").setup() which leads to the aforementionned issue
nvim-javais conflicting withmasonregardingjdtls,java-test, andspring-boot-tools#379 as a duplicate of this issueconfigfor nvim-java error #374 as a duplicate of this issuenvim-javaand failed integration withmasonandmason-lspconfig#382 as a duplicate of this issuelogrusx commentedon May 25, 2025
Is this why lombok stopped working?
zlendo1 commentedon May 31, 2025
Man, this sucks. Hope it gets resolved soon. Can we offer any assistance?
reckseba commentedon Jun 13, 2025
I am not sure if this is why my setup is not working. I have:
~/.config/nvim-kickstartinit.luaalias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'nvim-kickstart .When checking
:MasonI can tell thatjdtlswas not installed.Is that what you @s1n7ax mean by "At the moment nvim-java does not support Mason 2.0"? Though your recommended mitigration does not work for me.
Am I at the right spot?
Thanks and have a nice weekend everybody :)
snoweuph commentedon Jun 19, 2025
This issue should be a big warning at the top of the Readme.
I thought that I messed up load orders or something, but no, it's this.
Fixing mason to v1 fixed it for me though, it would be cool if something like this is in the readme, because that's where people look first when configuring a plugin.
Slava-Ini commentedon Jun 25, 2025
Pretty annoying issue, couldn't fix for a while - for some reason
get_installed_versionkept popping up in different placeSo for me that workaround solved the issue:
lazy-lock.jsonfile/home/{user}/.local/share/nvim/lazylogrusx commentedon Jun 25, 2025
I've locally fixed all Mason API calls, including in nvim-java-core and it still doesn't work. It seems it isn't only that.
Only pinning mason and mason-lspconfig to v1 works. However the following is not entirely complete:
If you already have packages installed with Mason v2, then you need to purge
/home/{user}/.local/share/nvim/masonas well. The easiest would be to purge the entire/home/{user}/.local/share/nvimdirectory. The worst that could happen is a few hundred of megabytes extra download.logrusx commentedon Jul 27, 2025
I'm trying to move nvim-java forward here, whoever wants to try to help, please join.
logrusx commentedon Jul 29, 2025
Migration is complete in my repo along with some fixes. Go check it out. Check the branches and the discussion for details. Skip the earlier comments and see the last few.
logrusx commentedon Jul 31, 2025
@s1n7ax I've created 2 PR's in nvim-java and nvim-java-core along with one in starter-kickstart that should move nvim-java to Mason 2.0 compatibility.
To keep nvim-java running on Mason 2.0 at its current state, fixes are necessary in the custom mason registry. I'm not interested in using it so I haven't fixed it. Also I found it hard to find documentation what and if I need to change something related to Mason 2.0. I think it might be as simple as just fixing the download URL's. I'm leaving this job for you.
I've also modified nvim-java and nvim-java-core to use the official mason repository only. I'm not creating PR's for it because I don't know if you would be willing to merge it. You can review the changes in my repo and if you want, I'll prepare PR's for you or you can do it yourself.
Another modification I've made is to be able to use latest versions of everything by passing * for the version.
Let me know if you need something from my side.
p.s. Thank you very much for the effort you've put to put nvim-java together.
s1n7ax commentedon Jul 31, 2025
Does this still have the compatibility for Mason 1.0? Lazyvim still is using 1.0
logrusx commentedon Jul 31, 2025
No. I saw it was possible but I decided I'm not going down that path.
Just tag the new release with v3.0.0 and add to the README that people need to use version = "^2.0.0" for mason 1.0.
s1n7ax commentedon Jul 31, 2025
make sense. Please go ahead and create PRs. Could you please mention all the PRs that should be merged here as well.
logrusx commentedon Aug 2, 2025
@s1n7ax it's taking a bit more time but I might actually be able to make it backward compatible. Stay tuned.
logrusx commentedon Aug 3, 2025
@s1n7ax I need issue #403 closed to spare you resolving conflicts. PR #405 is linked and resolves it. Could you please also look at #406. It would be nice to have that closed too.
s1n7ax commentedon Aug 4, 2025
#405 and #406 merged
logrusx commentedon Aug 5, 2025
@s1n7ax PR's nvim-java/nvim-java-core#93 (issue nvim-java/nvim-java-core#91) and #402.
Then nvim-java/starter-kickstart#3 should make the necessary changes for kickstart to work with mason 2.0
s1n7ax commentedon Aug 6, 2025
Merged. Now you should be able to use Mason 1.0 as well as Mason 2.0. @logrusx Thanks for the hard work. Hope we can see more contributions in the future from Java devs as I'm no longer a Java dev nor hoping to contribute to this.
logrusx commentedon Aug 6, 2025
Thank you too! Thank you too for that I've learned a lot from your code!
That's my hope too. That's why I wanted the changes to be merged back and not spread around countless forks.
Zeioth commentedon Aug 6, 2025
I've tested nvim-java v3.0 with mason 2.0 and all seems to work fine. We are going to ship nvim-java with NormalNvim once more.
EDIT: Done!