Closed lesad closed 1 year ago
Hey! I personally use both java11 and java17 too and the only difference that I see is that your paths don't have a slash (/
) at the end of them.
Try replacing path = java .. "/11.0.19-tem"
with path = java .. "/11.0.19-tem/"
and see if it works, I'll also link you my config for reference (bare in mind that vim.fn.glob will expand to a list if it finds multiple results so it will not work if you have more than 1 java 17 installed)
configuration = {
-- Name is NOT arbitrary: must match one of the elements from `enum ExecutionEnvironment` in the link below
-- https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
runtimes = {
{ name = "JavaSE-11", path = vim.fn.glob("$SDKMAN_DIR/candidates/java/11.*/") },
{ name = "JavaSE-17", path = vim.fn.glob("$SDKMAN_DIR/candidates/java/17.*/") },
}
}
Sorry for such a delay, I have been trying to get some insights on the problem. The first thing I've tried is to use the manual approach (without your launcher). This worked as expected, the project got recognized and I've got the right suggestions.
Then I wanted to make sure that it's not project related. I have created two fresh project using Spring Initializr, one using Java 17 and the other using Java 11. This also worked as expected, either with or without the launcher.
I have also noticed some file being created on first launch with LSP (.classpath
, .project
, .settings
) that were not present before. They did not, however, get created in the project in question. And I still got the warning.
Might I ask, how is the workspace folder for multiple different projects handled? I can't see the script making this distinction.
To be honest I'm confused, there's no special handling for any of this thing really. The only problem I can think of is that this script uses the default java version which has to be 17 for jdtls to work.
https://github.com/eruizc-dev/jdtls-launcher/blob/master/jdtls-launcher.sh#L215-L227
Can you create a repo in which jdtls-launcher fails to start so I can clone and replicate your issue?
I can't seem to replicate the issue. It seems to be project-specific but I can't share as it is private to the company I work for. I'll try to pick out the problematic part and close the issue in the meantime..
Hi! The launcher works fine on projects using Java 17 but I can't get it to work with older versions. Here is my setup (fresh install):
Neovim config:
LSP logs (at least those that I could fine doesn't show anything suspicious, apart from this error:
[ERROR][2023-06-13 11:27:35] ...lsp/handlers.lua:535 "Jun 13, 2023, 11:27:35 AM Command _java.reloadBundles.command not supported on client"
LspInfo looks OKnvim --version :