From 3217bcb83efda44392047ceae5f3ac0febb3207d Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Fri, 19 Sep 2025 09:59:13 -0400 Subject: [PATCH] docs: Add Kotlin JAVA_HOME example (#38507) Closes: https://github.com/zed-extensions/kotlin/issues/46 Release Notes: - N/A --- docs/src/languages/kotlin.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/src/languages/kotlin.md b/docs/src/languages/kotlin.md index 3955062a77783629c0bd838f7dd093af31f3aa0d..60d66f277eb62c2bdf9905687045abbca4db20b9 100644 --- a/docs/src/languages/kotlin.md +++ b/docs/src/languages/kotlin.md @@ -11,6 +11,12 @@ Report issues to: [https://github.com/zed-extensions/kotlin/issues](https://gith Workspace configuration options can be passed to the language server via lsp settings in `settings.json`. +The full list of lsp `settings` can be found +[here](https://github.com/fwcd/kotlin-language-server/blob/main/server/src/main/kotlin/org/javacs/kt/Configuration.kt) +under `class Configuration` and initialization_options under `class InitializationOptions`. + +### JVM Target + The following example changes the JVM target from `default` (which is 1.8) to `17`: @@ -30,5 +36,20 @@ The following example changes the JVM target from `default` (which is 1.8) to } ``` -The full list of workspace configuration options can be found -[here](https://github.com/fwcd/kotlin-language-server/blob/main/server/src/main/kotlin/org/javacs/kt/Configuration.kt). +### JAVA_HOME + +To use a specific java installation, just specify the `JAVA_HOME` environment variable with: + +```json +{ + "lsp": { + "kotlin-language-server": { + "binary": { + "env": { + "JAVA_HOME": "/Users/whatever/Applications/Work/Android Studio.app/Contents/jbr/Contents/Home" + } + } + } + } +} +```