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