1---
2title: Kotlin
3description: "Configure Kotlin language support in Zed, including language servers, formatting, and debugging."
4---
5
6# Kotlin
7
8Kotlin language support in Zed is provided by the community-maintained [Kotlin extension](https://github.com/zed-extensions/kotlin).
9Report issues to: [https://github.com/zed-extensions/kotlin/issues](https://github.com/zed-extensions/kotlin/issues)
10
11- Tree-sitter: [fwcd/tree-sitter-kotlin](https://github.com/fwcd/tree-sitter-kotlin)
12- Language Server: [fwcd/kotlin-language-server](https://github.com/fwcd/kotlin-language-server)
13- Alternate Language Server: [kotlin/kotlin-lsp](https://github.com/kotlin/kotlin-lsp)
14
15## Configuration
16
17Workspace configuration options can be passed to the language server via lsp
18settings in `settings.json`.
19
20The full list of lsp `settings` can be found
21[here](https://github.com/fwcd/kotlin-language-server/blob/main/server/src/main/kotlin/org/javacs/kt/Configuration.kt)
22under `class Configuration` and initialization_options under `class InitializationOptions`.
23
24### JVM Target
25
26The following example changes the JVM target from `default` (which is 1.8) to
27`17`:
28
29```json [settings]
30{
31 "lsp": {
32 "kotlin-language-server": {
33 "settings": {
34 "compiler": {
35 "jvm": {
36 "target": "17"
37 }
38 }
39 }
40 }
41 }
42}
43```
44
45### JAVA_HOME
46
47To use a specific java installation, just specify the `JAVA_HOME` environment variable with:
48
49```json [settings]
50{
51 "lsp": {
52 "kotlin-language-server": {
53 "binary": {
54 "env": {
55 "JAVA_HOME": "/Users/whatever/Applications/Work/Android Studio.app/Contents/jbr/Contents/Home"
56 }
57 }
58 }
59 }
60}
61```