# Installation

Gradle coordinates, platform requirements, and the supported-platform matrix.


## Add the dependency

simdjson-kotlin is published to Maven Central. Add the core module to your
`commonMain` source set:

```kotlin
kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("io.github.devcrocod:simdjson-kotlin:0.1.0")
        }
        // optional: kotlinx.serialization support (currently JVM-only)
        jvmMain.dependencies {
            implementation("io.github.devcrocod:simdjson-kotlin-serialization:0.1.0")
        }
    }
}
```

The core module gives you the [DOM](../../guides/dom/) and
[On-Demand](../../guides/on-demand/) APIs on every supported target. The
optional `simdjson-kotlin-serialization` module adds
[kotlinx.serialization](../../guides/serialization/) decoding on the JVM.

## Requirements

<table class="kt-params">
  <thead>
    <tr><th>Parameter</th><th>Description</th></tr>
  </thead>
  <tbody><tr>
          <td>
            <code class="kt-params__name">JVM</code><span class="kt-params__type">JDK 11&#43;</span></td>
          <td>On JDK 24+ the parser uses the pure-Kotlin Vector API backend. Add <code>--add-modules jdk.incubator.vector</code> to enable it. On older JDKs, or when the Vector API is unavailable, it transparently falls back to a JNI backend with bundled native simdjson libraries (pulled in transitively via <code>simdjson-kotlin-jni-runtime</code>).</td>
        </tr><tr>
          <td>
            <code class="kt-params__name">Android</code><span class="kt-params__type">minSdk 26</span></td>
          <td>Uses the JNI backend.</td>
        </tr><tr>
          <td>
            <code class="kt-params__name">Kotlin</code><span class="kt-params__type">2.4</span></td>
          <td>The library is built with Kotlin 2.4.</td>
        </tr></tbody>
</table>


<aside class="kt-callout kt-callout--tip">
  <svg class="kt-callout__icon" viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18h6"/><path d="M10 22h4"/><path d="M12 2a7 7 0 0 1 7 7c0 3-2 5-3 6.5V18H8v-2.5C7 14 5 12 5 9a7 7 0 0 1 7-7z"/></svg>
  <div class="kt-callout__body"><strong class="kt-callout__title">Forcing a backend</strong><div class="kt-callout__content">On the JVM you can force the parser backend with the system property
<code>-Dsimdjson.backend=vector</code> or <code>-Dsimdjson.backend=jni</code>.</div>
  </div>
</aside>


## Supported platforms

| Target                                      | Implementation                |
|---------------------------------------------|-------------------------------|
| JVM (JDK 24+)                               | Vector API (pure Kotlin SIMD) |
| JVM (JDK 11–23)                             | JNI → native simdjson         |
| Android                                     | JNI → native simdjson         |
| macosArm64 / iosArm64 / iosSimulatorArm64   | cinterop → simdjson C++       |
| linuxX64                                    | cinterop → simdjson C++       |
