dap-buddy.nvim
dap-buddy.nvim copied to clipboard
Java debugger implementation disscussion
So this should be straightforward (IMHO). The implementation has been done by Microsoft, and I think the implementation here could be as straightforward as python for an example. I want to contribute to this project since this is a great project in my opinion. Let me know if there is any opinion about this initial discussion
Hey! I was checking java-debug
and it really isn't hard to implement, it's very straightforward as you said.
Feel free to PR it, it'd be awesome!
Any updates?
This is what I did to install java-debug, works on macOS and Linux (never tested, but should work, though the JAVA_HOME path might need to be amended)
I couldn't compile it with Java 17, so I had to link it to the home directory of Java 11 JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
function _G.install_javadebug()
local installation_path = vim.fn.stdpath("data") .. "/dapinstall/"
if vim.fn.isdirectory(installation_path) == 0 then
vim.fn.mkdir(installation_path)
end
installation_path = installation_path .. "/java-debug"
vim.fn.mkdir(installation_path)
local git_url = "https://github.com/microsoft/java-debug"
vim.fn.system({ "git", "clone", git_url, installation_path })
vim.cmd(
"split | terminal cd "
.. installation_path
.. " && JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home ./mvnw clean install"
)
end
function _G.uninstall_javadebug()
local installation_path = vim.fn.stdpath("data") .. "/dapinstall/java-debug"
vim.fn.delete(installation_path, "rf")
print("Java-debug uninstalled")
end
vim.cmd("command! DIInstallJava call v:lua.install_javadebug()")
vim.cmd("command! DIUninstallJava call v:lua.uninstall_javadebug()")
Getting the debugger working with jdtls is a whole different story though as it involves installing the nvim-jdtls plugin, attaching it to the LSP and configuring some initialisation options
This is what I did to install java-debug, works on macOS and Linux (never tested, but should work, though the JAVA_HOME path might need to be amended)
I couldn't compile it with Java 17, so I had to link it to the home directory of Java 11
JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
Might be a stupid question but why not just get the artifact ? https://search.maven.org/artifact/com.microsoft.java/com.microsoft.java.debug.plugin https://repo1.maven.org/maven2/com/microsoft/java/com.microsoft.java.debug.plugin/
I basically don't know lua, so I made a local PKGBUILD where I would get the latest version, getting the proper latest version was a pipe hell but it worked. It also seemed to work with java 18 EA.
( In the end I gave up and just installed eclipse-plaform with vrapper on my work laptop but I would like to reach a day when all this works similar to how lsps work on nvim )