I am trying to debug my java web application (using emacs), but I am having issues setting it up to connect with the debug port.

Within emacs I have installed both lsp-java and dap.

The debug port of the web application is port 3000 (on localhost). How do I setup a connection using dap to connect to the remote server?


Do M-x dap-debug and select Java attach template.

  • Hi Ivan, I tried to do what you said. When I selected Java attach it prompted me to enter the port. I entered my debug port 3000; however, it still did not work. I set up some break points, but the breakpoints are not working. I do not believe that the remote server attached properly. Please advise. – Dan Dec 7 '19 at 21:52
  • Here it is how dap-java starts a process and then connects to it (format "%s -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%s" dap-java-java-command port). Can you verify that your server is started using similar params? FYI dap-java uses run command and attach to the process when executing tests tests. – Ivan Dimitrov Yonchovski Dec 8 '19 at 5:26
  • I am unsure about what you want me to do. Please clarify. – Dan Dec 9 '19 at 1:28
  • Sorry, I want to ensure that your application is started with the params listed in the previous comment. – Ivan Dimitrov Yonchovski Dec 9 '19 at 8:24
  • The server does start with the debug port. Right now I am debugging my web application using eclipse. In eclipse I set it up to connect to my web application's debug port. I am currently unable to do replicate this using emacs dap. – Dan Dec 9 '19 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.