-
Hello, This is my current jdtls config local workspace_dir = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
local config = {
cmd = {
'/Users/wviana/.sdkman/candidates/java/17.0.6-zulu/bin/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',
'-noverify',
'-Xmx1G',
'-javaagent:/Users/wviana/Apps/lombok.jar',
-- '-Xbootclasspath/a:/Users/wviana/Apps/lombok.jar',
'--add-modules=ALL-SYSTEM',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'-jar', '/usr/local/Cellar/jdtls/1.20.0/libexec/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar',
'-configuration', '/usr/local/Cellar/jdtls/1.20.0/libexec/config_mac',
'-data', '/Users/wviana/.cache/jdtls-workspace/' .. workspace_dir,
},
on_attach = on_attach,
capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()),
root_dir = require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew'}),
init_options = {
bundles = {
vim.fn.glob('/Users/wviana/Apps/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar')
}
}
}
jdtls.start_or_attach(config) This is the output of JdtShowLogs for the failing project:
Is there anything else I can provide to help investigate it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Can you provide the project link on your Github? It may be helpful to investigate the issue. root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]), |
Beta Was this translation helpful? Give feedback.
-
Upvoting since I am facing the same exact issue. |
Beta Was this translation helpful? Give feedback.
Hi there. I find out what was the problem. The project that was not working was using Gradle 6.8. I've used a guide from Gradle website. Migrated the project into some 7 version. Now it works.
For figure it out, I think I called JdtCompile and than it got me an error about the Gradle version.
Think about trying to change jdtls code to rise those errors to user.