Elide bundles Kotlin 2.5.0-Beta1 and JDK 25 with a build tool, Maven dependency resolver, JUnit runner and ktfmt.
Run the same code
A file with a main function compiles and runs directly:
elide run Main.ktelide kotlinc, elide java and elide jar run the Kotlin and JDK tools. Their arguments go after --:
elide kotlinc -- -version
elide kotlinc -- -d out Main.ktA project is an elide.pkl file. Maven dependencies, kotlinx.serialization, kotlinx.coroutines and JUnit need no
plugin blocks:
elide init --plain --skip-defaults --template ktjvm # new project
elide install # resolve Maven dependencies
elide build # compile and assemble
elide test # run JUnit tests
elide run # run jvm.main
elide format -- src # ktfmtSee Java and Kotlin with Elide, Kotlin Compiler,
Testing and the elide.pkl reference.
What changes
| With kotlinc and Gradle | With Elide |
|---|---|
Install a JDK and kotlinc | Nothing; both are bundled. |
kotlinc Main.kt -d out | elide kotlinc -- -d out Main. |
build.gradle.kts | elide.pkl |
kotlin("jvm") version "2. | kotlin { toolchain = new Kotlin. |
kotlin("plugin. | On by default (kotlin.features). |
Subprojects in settings.gradle.kts | workspace { members { "core"; "app" } } in the root elide.pkl |
./gradlew build, test, run | elide build, elide test, elide run |
Migrate a ./gradlew build | elide adopt; see Adopt an Existing Project. |
ktfmt | elide format |
| IDE project import | elide project export --format= |
kapt, ksp | No equivalent. |
ManagedKotlinToolchain needs import "elide:Kotlin.pkl" as Kotlin and applies to project builds; elide kotlinc
always uses the bundled Kotlin.
Benchmarks
No benchmarks are published for JVM programs in 1.6.0. For ahead-of-time builds, see Native Image.
Strengths
- One binary replaces the JDK,
kotlinc, the Maven resolver, the JUnit launcher and ktfmt. - kotlinx.serialization, coroutines, Power Assert and Metro are enabled without configuration. atomicfu is on too, with its runtime library.
ManagedKotlinToolchainbuilds a project with another Kotlin version, prereleases included.- Workspace members can read a sibling’s
internaldeclarations withproject("core").friend().
Weaknesses
- No Gradle support:
elide builddoes not readbuild.gradle.kts, and Gradle plugins have no equivalent. - KAPT and KSP are unsupported; Kotlin that uses Java-generated types must take them from an upstream source set.
- The bundled compiler is Kotlin 2.5.0-Beta1, a beta.
elide javadoes not addkotlin-stdlib(NoClassDefFoundError), andelide kotlinc -- -include-runtimefails. Run withelide run, or package with aJvm.JvmApplication(JAR Assembly).elide adoptis untested on multi-module and Android projects.