I need help setting up jdtls #607
Unanswered
samwiseKuta
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I went through the documentation like 30 times already, trying to configure it myself, with youtube tutorials and my most recent attempt with the already completed configs on the official wiki.
That being said, jdtls just doesn't attach. I'll try and post as much necessary information in here as possible, so if someone can help me I'd be really grateful.

:LspInfo output:
It says the client is active in the background, but it's not attaching to any .java file.
Config
I'm using the @pavva config from the official wiki, here it is:
return{
"mfussenegger/nvim-jdtls",
config = function()
local jdtls = require("jdtls")
local jdtls_dap = require("jdtls.dap")
local jdtls_setup = require("jdtls.setup")
local home = os.getenv("HOME")
}
Troubleshooting attempt
I should also mention that I went to the troubleshooting page, and tried the following:
:set ft=java - Nothing really happens when I invoke this, the output of LspInfo just changes color for some reason, but there is no message.
:JdtCompile full is not recognized as a command, and :lua require('jdtls').compile('full') throws an error message saying No LSP client with name 'jdtls' available, which really confuses me as it's right there on the screen being recognized by LspInfo
Lsp handler not calling setup, letting nvim-jdtls do it
This is a part of my lsp config. For 'jdtls' it ignores setup and does nothing, so that nvim-jdtls can to the setup. From what I understand this is how it's supposed to be, but maybe it's wrong.
handlers = {
function(server_name)
require("lspconfig")[server_name].setup{}
end,
["lua_ls"] = function ()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup {
settings = {
Lua = {
diagnostics = {
globals = { "vim" }
}
}
}
}
end,
["jdtls"] = function()
end
}
Beta Was this translation helpful? Give feedback.
All reactions