You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Document Gradle behavior with JDKs lower than 17
- Add instructions for configuring Maven settings.xml to resolve
dependencies from custom or internal repositories
- Expand example settings with kotlinSupport and other language
support options (Scala, AspectJ, Android, javac)
Copy file name to clipboardExpand all lines: README.md
+60-1Lines changed: 60 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,6 +222,30 @@ JDTLS will automatically pick the appropriate runtime based on your project's so
222
222
>
223
223
> **Windows paths** typically look like `C:\Program Files\Java\jdk-17`
224
224
225
+
> **Important:** If your default runtime is below Java 17 and you're working with Gradle projects, the Gradle daemon will fail to start because modern Gradle requires JVM 17+. In this case, set `java.import.gradle.java.home` to a JDK 17+ path so that the Gradle daemon uses a compatible JVM independently of your project's compilation runtime. See the [Advanced Configuration](#advanced-configurationjdtls-initialization-options) section below for details.
226
+
227
+
## Maven Configuration
228
+
229
+
If your project uses custom or internal Maven repositories, you should point JDTLS at your Maven `settings.xml` so it can resolve dependencies:
230
+
231
+
```jsonc
232
+
"initialization_options": {
233
+
"settings": {
234
+
"java": {
235
+
"configuration": {
236
+
"maven": {
237
+
"userSettings":"~/.m2/settings.xml",
238
+
// Optional: global settings for system-wide configuration
239
+
"globalSettings":"/path/to/global/settings.xml"
240
+
}
241
+
}
242
+
}
243
+
}
244
+
}
245
+
```
246
+
247
+
Without this, JDTLS's embedded Maven will only resolve artifacts from Maven Central, which will cause unresolved dependency errors for projects using internal or private repositories.
JDTLS provides many configuration options that can be passed via the `initialize` LSP-request. The extension will pass the JSON-object from `lsp.jdtls.initialization_options` in your settings on to JDTLS. Please refer to the [JDTLS Configuration Wiki Page](https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request) for the available options and values.
@@ -245,7 +269,11 @@ Below is an opinionated example configuration for JDTLS with most options enable
245
269
"java": {
246
270
"configuration": {
247
271
"updateBuildConfiguration":"automatic",
248
-
"runtimes": []
272
+
"runtimes": [],
273
+
// Path to your Maven settings.xml (for custom/internal repositories)
274
+
"maven": {
275
+
"userSettings":"~/.m2/settings.xml"
276
+
}
249
277
},
250
278
"saveActions": {
251
279
"organizeImports":true
@@ -261,11 +289,34 @@ Below is an opinionated example configuration for JDTLS with most options enable
261
289
},
262
290
"jdt": {
263
291
"ls": {
292
+
// Enables Protocol Buffer support for .proto files in the project
264
293
"protobufSupport": {
265
294
"enabled":true
266
295
},
296
+
// Enables Groovy support for mixed Java/Groovy projects
267
297
"groovySupport": {
268
298
"enabled":true
299
+
},
300
+
// Enables Kotlin support so JDTLS can resolve Kotlin classes from Java code
301
+
// in mixed Kotlin/Java projects
302
+
"kotlinSupport": {
303
+
"enabled":true
304
+
},
305
+
// Enables Scala support for mixed Java/Scala projects
306
+
"scalaSupport": {
307
+
"enabled":true
308
+
},
309
+
// Enables AspectJ support for projects using aspect-oriented programming
310
+
"aspectjSupport": {
311
+
"enabled":true
312
+
},
313
+
// Enables Android project support
314
+
"androidSupport": {
315
+
"enabled":true
316
+
},
317
+
// Enables the javac-based compilation engine instead of the ECJ compiler
318
+
"javac": {
319
+
"enabled":true
269
320
}
270
321
}
271
322
},
@@ -309,6 +360,14 @@ Below is an opinionated example configuration for JDTLS with most options enable
309
360
"enabled":true,
310
361
"wrapper": {
311
362
"enabled":true
363
+
},
364
+
// JVM used by the Gradle daemon (must be JVM 17+ for modern Gradle).
365
+
// Set this if your default runtime is a lower version.
0 commit comments