Repository navigation
Description
Did you check docs and existing issues?
- I have read all the plugin docs
- I have searched the existing issues
- I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.11.2
Operating system/version
WSL 2
Describe the bug
Hey,
Since the last update of Neovim, every time I open a .java file (AutoConfiguration for the DAP), I get this error:
dap configuration failed
RPC[Error] code_name = MethodNotFound, message = "No delegateCommandHandler for vscode.java.resolveMainClass"
stack traceback:
...vim/lazy/nvim-java/lua/java-core/utils/error_handler.lua:18: in function 'error_handler'
...ui/.local/share/nvim/lazy/nvim-java/lua/async/runner.lua:25: in function 'callback'
...lazy/nvim-java/lua/java-core/ls/clients/jdtls-client.lua:73: in function 'handler'
/usr/share/nvim/runtime/lua/vim/lsp/client.lua:681: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
11:07:10 PM msg_show.echomsg ja ERROR::"workspace/executeCommand failed! arguments: "::{
command = "vscode.java.resolveMainClass"
}::" error: "::{
code = -32601,
message = "No delegateCommandHandler for vscode.java.resolveMainClass",
= {
__tostring = <function 1>
}
}
I think a lot of new commands for DAP were added to the project. (By example: vscode.java.resolveMainClass)
If I disable java_debug_adapter, I no longer get this error in autoconfiguration of DAP, but if I try to run debugger, I encounter almost the same error. (vscode.java.startDebugSession instead of vscode.java.resolveMainClass)
Do you have the same error ?
i use JDTLS 1.54.0, java-debug-adapter 0.58.2 from Mason.
Thank you for your help :)
Steps To Reproduce
This is my config:
return {
{
"nvim-java/nvim-java",
config = function()
require("java").setup({
java_debug_adapter = {
enable = true,
},
spring_boot_tools = {
enable = false,
},
})
require("lspconfig").jdtls.setup({})
local dap = require("dap")
dap.configurations.java = {
{
mainClass = "",
projectName = "",
type = "java",
request = "attach",
name = "Debug (Attach) - Remote",
hostName = "127.0.0.1",
port = 5005,
},
}
end,
},
}
Expected Behavior
No error from DAP
Activity
logrusx commentedon Dec 10, 2025
We dropped Mason support and migrated to vim.lsp API. Do not use Mason for nvim-java stuff and do not call lspconfig.jdtls.setup.
s1n7ax commentedon Dec 10, 2025
Hi, you can upgrade nvim-java then you need to change the
require("lspconfig").jdtls.setup({})statement tovim.lsp.enable('jdtls'). You can try again. Please reopen the ticket if not workingorganix7 commentedon Dec 10, 2025
Hello, thank you for the feedback.
I found a solution, but I need to specify the vim.lsp.config for jdtls:
And I manually installed jdtls on my system (using the jdtls command)
I don't know if it is the expected solution...
If I don't specify a vim.lsp.config for jdtls, I get this warning and jdtls doesn't run:
Some info in LspInfo:
And this page is still good ? https://github.com/nvim-java/nvim-java/wiki/Lazyvim
s1n7ax commentedon Dec 10, 2025
Can you try deleting
~/.local/share/nvim/lazydirectory and re-installing all plugins from scratch?organix7 commentedon Dec 10, 2025
With this configuration :
After deleting ~/.local/share/nvim/lazy, I still get this warning :
And jdtls is not running.
s1n7ax commentedon Dec 10, 2025
Could you try upgrading to the latest stable version. 0.11.5. That must be it.
organix7 commentedon Dec 10, 2025
I installed version 0.11.5 and it works well !
Thanks for the help and the great work !