Skip to content

Java and Kotlin

The JVM binding uses JDK 25 and Aster’s native Rust engine. Java annotation processing and Kotlin KSP generate service and payload support for the same runtime. Use it for JVM applications that need peer calls while retaining Java futures, virtual-thread handlers, and deterministic native cleanup.

Start with the complete downloadable JVM project, which supplies compiler configuration, codec registration, and native loading. The dependency fragments below are parts of that setup.

Part Generated or supplied by Aster Your application supplies
Unary dispatch APT or KSP adapter and service-provider metadata Annotated implementation and build processor configuration
Payload codec Fory codec and registration helpers Registration of every payload, including nested types
Streaming dispatch Streaming SPI interfaces Explicit dispatcher and encode/decode logic
Native runtime Platform classifier artifact Matching classifier dependency and native-access launch flag

The preview is published to Aster’s Maven registry. Configure this repository in your Maven project:

<repositories>
<repository>
<id>aster</id>
<url>https://forge.emrul.dev/api/packages/Aster/maven</url>
</repository>
</repositories>

The runtime and annotation coordinates are:

<dependencies>
<dependency>
<groupId>site.aster</groupId>
<artifactId>aster-runtime</artifactId>
<version>0.3.893</version>
</dependency>
<dependency>
<groupId>site.aster</groupId>
<artifactId>aster-annotations</artifactId>
<version>0.3.893</version>
</dependency>
</dependencies>

Also include the release’s aster-runtime native classifier JAR for your operating system and architecture. For Linux x86-64 the classifier is linux-x86_64; it is an additional dependency with the same runtime version. The Java-only JAR does not replace the native library. Run with --enable-native-access=ALL-UNNAMED when using the classpath.

Java service generation uses site.aster:aster-codegen-apt; Kotlin uses site.aster:aster-codegen-ksp. Keep generated code, runtime, annotations, and native artifacts on the same release. The JVM tutorial provides the complete compiler, code-generation, and native setup with a tested downloadable project.

Kotlin calls the same JVM runtime and owns the same native resources as Java. It is not a separate native adapter. The RPC interoperability matrix qualifies Java alongside Rust, Python, TypeScript, Go, and .NET; Kotlin is not a separate entry in that matrix.

Use explicit wire names and matching field representations when interoperating with other bindings. Keep native owners alive for asynchronous operations and close subscriptions, clients, and servers deterministically. Telemetry goes through the shared Rust pipeline, with Rust log events forwarded to SLF4J.