how to configure java adapter to load java-debug? #1302
Replies: 3 comments 1 reply
-
Hi @joelpeapen, pls follow below, hope works for you... To integrate the Java debugger with your existing nvim-jdtls setup, you'll need to ensure proper configuration for both nvim-dap and the Java Debug Adapter. Here’s a structured approach to resolve the issues you’re encountering: Ensure Dependencies Are Installed:
Configure the Java Debug Adapter:
This setup tells nvim-dap where to find the Java Debug Adapter and how to connect to it. Configure nvim-jdtls:Ensure nvim-jdtls is configured correctly to work with nvim-dap. Verify that your jdtls configuration aligns with your debugging setup:
Launch Your Java Application for Debugging:Make sure your Java application is started with debugging enabled. Use the following command: Trigger the Debug Session:From Neovim, you can start the debugging session using: Ensure the Java application is correctly listening on the port specified in your configuration. Troubleshoot Common Errors:
|
Beta Was this translation helpful? Give feedback.
-
The error indicates that the |
Beta Was this translation helpful? Give feedback.
-
Turns out the problem with the bundles was i concatenated my adapter looks like this: dap.adapters.java = function(callback)
vim.lsp.buf.execute_command({
command = "vscode.java.startDebugSession"
}) -- not sure how to get the port from this command
callback({
type = "server";
host = "127.0.0.1";
port = 5005;
})
end which returns should i be using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The wiki says we can set up the java debugger independently of nvim-jdtls.
My LSP is already setup with lsp-config.
How exactly do i configure the java adapter to get the LSP to trigger the command
vscode.java.startDebugSession
?Calling
dap.continue()
gives this error:Beta Was this translation helpful? Give feedback.
All reactions