starter.lvim
starter.lvim copied to clipboard
Client 1 quit with exit code 1 and signal 0. (java starter)
I'm using the starter.lvim and sdkman tool but cannot git it works. IM getting "Client 1 quit with exit code 1 and signal 0" after open a java project with same java version.
local/state/lvim/lsp.log:
[INFO][2024-01-18 22:56:21] .../lua/vim/lsp.lua:1344 "LSP[null-ls]" "server_capabilities" { server_capabilities = { codeActionProvider = { resolveProvider = false }, completionProvider = { allCommitCharacters = {}, completionItem = { labelDetailsSupport = true }, resolveProvider = false, triggerCharacters = { ".", ":", "-" } }, documentFormattingProvider = true, documentRangeFormattingProvider = true, executeCommandProvider = true, hoverProvider = true, textDocumentSync = { change = 1, openClose = true, save = { includeText = true } } }} [ERROR][2024-01-18 22:56:21] .../vim/lsp/rpc.lua:734 "rpc" "java" "stderr" "Unrecognized option: --add-modules=ALL-SYSTEM\nError: Could not create the Java Virtual Machine.\nError: A fatal exception has occurred. Program will exit.\n"
What Java version are you using?
try edit java.lua
the path to jdtls should be under lvim, not nvim. After update it it worked for me.
local config = {
cmd = {
"java",
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dlog.protocol=true",
"-Dlog.level=ALL",
"-Xms1g",
"--add-modules=ALL-SYSTEM",
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
"-javaagent:" .. home .. "/.local/share/nvim/mason/packages/jdtls/lombok.jar",
"-jar",
vim.fn.glob(home .. "/.local/share/nvim/mason/packages/jdtls/plugins/org.eclipse.equinox.launcher_*.jar"),
"-configuration",
home .. "/.local/share/nvim/mason/packages/jdtls/config_" .. os_config,
"-data",
workspace_dir,
},