# Kotlin

> KotlinBuild compiles Kotlin and Java side by side, with the standard library that matches the compiler.

**KotlinBuild compiles Kotlin and Java side by side, adds the standard library that matches the compiler, tests with JUnit and builds a jar.**

Build system: `KotlinBuild`
Start one: `plinto create kotlin-service HelloApp` (or `kotlin-lib`)
Ships as: the same archive as [Java](java.md#releases)

## The project {#project}

The layout is Java's: `src/`, `resources/`, `tst/` and `tst-resources/`, with `.kt` and `.java` files mixed as you like.

```conf file=plinto.conf
{
  name = HelloApp
  version = 1.0
  build = KotlinBuild
  main = helloapp.MainKt         # a top-level main in src/helloapp/Main.kt

  build-dependencies: {
    KotlinBuild = 1.0
    Java = 25                    # to run the compiler and your tests
    Kotlin = 2.4.20              # the compiler
  }
  test-dependencies: {
    JUnitJupiter = 6
  }
}
```

The standard library comes along at the compiler's version, so `KotlinStdLib` is never declared.

## Settings {#settings}

Everything [JavaBuild takes](java.md#settings), in `configuration/KotlinBuild.config`, and:

| Key | What it does |
|---|---|
| `kotlin.jvm-target` | the JVM version the Kotlin code is compiled for (default: `java.release`) |
| `kotlin.compiler-args` | more arguments for the Kotlin compiler |
| `kotlin.compiler-plugins` | compiler plugins to load |

## Libraries, tests and releases {#more}

As for [Java](java.md#libraries): Maven artifacts through `plinto import maven`, JUnit tests in `tst/`, a jar, and for a program an archive with its own JDK.

- [Java](java.md): what both share
- [Editors](../guides/editors.md): IntelliJ IDEA
- [Version groups](../concepts/version-groups.md): where 2.4.20 comes from
