Closed yimingwangdell closed 10 months ago
is java 11 supported as documentation said?
eclipse.jdt.ls itself requires at least java 17 You can use it to work on projects with a lower java source-/targetCompatibility but at least the gradle version needs to be compatible with java 17. At least until https://github.com/eclipse-jdtls/eclipse.jdt.ls/pull/2812 - I think after that it tries to detect a compatible version.
LSP client configuration
-- See
:help vim.lsp.start_client
for an overview of the supportedconfig
options. local config = { -- The command that starts the language server -- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line cmd = { -- š -- '/usr/lib/jvm/java-20-openjdk/bin/java', -- or '/path/to/java17_or_newer/bin/java' -- depends on ifjava
is in your $PATH env variable and if it points to the right version. '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', '-Xmx1g', '--add-modules=ALL-SYSTEM', '--add-opens', 'java.base/java.util=ALL-UNNAMED', '--add-opens', 'java.base/java.lang=ALL-UNNAMED',}
-- This starts a new client & server, -- or attaches to an existing client & server depending on the
root_dir
. require('jdtls').start_or_attach(config)Eclipse.jdt.ls version
org.eclipse.equinox.launcher_1.6.500.v20230717-2134.jar
Steps to Reproduce
open a java file of project with java 11 and gradle 5.6.4
Expected Result
able to compile
Actual Result
in console Can't use Java 20.0.2 and Gradle 7.4.2 to import Gradle project
in log message = "Sep 6, 2023, 6:30:40 PM Error occured while building workspace. Details: \n message: The supplied phased action failed with an exception.\nExecution failed for task ':buildSrc:compileGroovy'.\nBUG! exception in phase 'semantic analysis' in source unit ..............................Unsupported class file major version 64\nUnsupported class file major version 64; code: 0; resource: ..............................;\n message: Can't use Java 20.0.2 and Gradle 7.4.2 to import Gradle project ....; code: 0; resource: ................................; line: 1", type = 1 }
question
I have no idea why it use 20.0.2 and 7.4.2 ?? I haven't install them though. is it a BUG as log said? is java 11 supported as documentation said?