# JVM Toolchain

> Compile, run, format, test and package Java and Kotlin.

Elide bundles JDK 25 and Kotlin 2.5.0-Beta1.

## Compile and run

```bash
elide javac -- -d out Hello.java
elide java -- -cp out Hello

elide kotlinc -- -d out Hello.kt
elide java -- -cp out HelloKt
```

Options for the wrapped tool go after `--`.

## Format

```bash
elide format -- src
elide format -- -n src # check only
```

Per-formatter options: [Formatting](https://elide.help/docs/toolchain/jvm/formatting).

## Build a project

With an `elide.pkl` manifest:

```bash
elide install
elide build
elide test
```

Sources in `src/main/java`, `src/main/kotlin` and `src/test/…` are found without configuration. JVM tests need a
manifest. Coverage: [Testing](https://elide.help/docs/toolchain/testing#coverage).

In a terminal, the task line shows the file or source count being compiled. In CI, with redirected output, or run by
an agent, the build prints one plain line per task.

## Existing build systems

- Call the wrappers (`elide javac -- …`) from any build.
- Set `JAVA_HOME` to the Elide distribution; it has `bin/java`, `bin/javac` and the other JDK tools.
- Bazel: `elide javac --persistent_worker` and `elide kotlinc --persistent_worker`.

`elide --help-all` lists every command.
