# Run on the JVM

If your desktop ePOS app runs on the JVM, you can add the Teya PosLink SDK to your app as a normal library dependency and call it directly.

## Is this page for you?

| Your ePOS app                                                        | What to use                                                                                  |
|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| Runs on the JVM — Java or Kotlin (JavaFX, Swing, Compose Desktop, …) | **This page.** Add the SDK as a library.                                                     |
| Does not run on the JVM — C#, C++, Electron, …                       | The Teya Integrations App. See [Getting started](/epos-sdk/poslink/windows/getting-started). |

## What you skip

The Teya Integrations App exists because we cannot assume a desktop ePOS app runs on a JVM. If yours does, you don't need it — or any of the integration work that comes with it:

- No subprocess to launch and keep alive.
- No JSON-RPC messages to build, send and parse.
- No public certificate to verify.
- No child-process lifecycle to tie to your own.

Your code calls SDK functions directly, the same way our Android and iOS SDKs work.

## Requirements

| Component | Version        |
|-----------|----------------|
| **Java**  | 17 or newer    |
| **OS**    | Windows on x64 |

## Add the dependency

The artifact name ends in the platform you ship to, so that the choice is explicit and identical on every build machine — including CI running a different OS to the one you ship to:

```
com.teya.epos:unified-sdk-poslink-jvm-windows-x64
```

Replace `SDK_VERSION` below with the latest version:

[![Maven (stable)](https://img.shields.io/badge/dynamic/xml?label=maven-central&style=for-the-badge&color=rgb(222,224,99)&url=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Fteya%2Fepos%2Funified-sdk-poslink-jvm-windows-x64%2Fmaven-metadata.xml&query=%2F%2Fmetadata%2Fversioning%2Fversions%2Fversion%5Bnot(contains(text()%2C%27-%27))%5D%5Blast()%5D)](https://central.sonatype.com/artifact/com.teya.epos/unified-sdk-poslink-jvm-windows-x64)

```tabs
    tab:
      title: Maven
      content:
        ```xml
        <repositories>
            <repository>
                <id>google</id>
                <url>https://maven.google.com</url>
            </repository>
        </repositories>

        <dependencies>
            <dependency>
                <groupId>com.teya.epos</groupId>
                <artifactId>unified-sdk-poslink-jvm-windows-x64</artifactId>
                <version>SDK_VERSION</version>
                <type>pom</type>
            </dependency>
        </dependencies>
        ```

    tab:
      title: Gradle
      content:
        ```kotlin
        repositories {
            mavenCentral()
            google()
        }

        dependencies {
            implementation("com.teya.epos:unified-sdk-poslink-jvm-windows-x64:SDK_VERSION")
        }
        ```
```

Google's Maven repository is needed alongside Maven Central because a few of the SDK's dependencies are only published there.

```admonition
icon: fas fa-exclamation-triangle
title: Maven only
content: |
    Keep the `pom` type in the snippet above. This artifact ships no jar of its own — it is a small descriptor that pulls in the SDK together with the right native library for your platform. Leave the type out and Maven defaults to looking for a jar that does not exist, and your build fails.
```

### Other platforms

Windows x64 is the platform we support in production. These also exist and behave the same way — use them if you develop or test on another machine:

| Platform      | Artifact                                |
|---------------|-----------------------------------------|
| Windows x64   | `unified-sdk-poslink-jvm-windows-x64`   |
| Windows arm64 | `unified-sdk-poslink-jvm-windows-arm64` |
| macOS arm64   | `unified-sdk-poslink-jvm-macos-arm64`   |
| macOS x64     | `unified-sdk-poslink-jvm-macos-x64`     |
| Linux x64     | `unified-sdk-poslink-jvm-linux-x64`     |
| Linux arm64   | `unified-sdk-poslink-jvm-linux-arm64`   |

## Start from the sample

The quickest way in is our Java sample app — a working desktop ePOS app built on the dependency above, covering both integration flows end to end:

- **Sale** — browse a product catalogue, add items to a basket, take a payment with an optional tip, and print a receipt.
- **Pay at Table** — terminals drive the bill and the payment for open tabs, and the app responds to the events.

[View the Java sample on GitHub](https://github.com/teya-engineering/unified-epos-sdk/tree/main/java-samples/poslink/EposPosLinkExample)

Its README covers running it: set your `clientId` and `clientSecret`, then `./mvnw javafx:run`.

```admonition
type: info
icon: fas fa-info-circle
content: This sample app is a reference implementation for learning and development purposes. It is not intended for production use.
```

## Where the functions are documented

The JVM SDK is the same Kotlin/Java API as our Android SDK, so the **[Android guides](/epos-sdk/poslink/android/getting-started)** document every function you will call — setup, payments, payment states, tips, refunds, custom receipts and Pay at Table. Every code sample there has a **Kotlin** and a **Java** tab, so switch to whichever you are writing.

Two things to keep in mind while reading them:

- Skip their *Getting Started* page — the dependency setup above replaces it.
- Ignore the Android-specific bits, such as `minSdkVersion` and Gradle plugin requirements. Everything about the SDK's own API applies to your JVM app as written.

For signatures and types, the [SDK API reference](/kotlin-docs) covers the whole SDK. The `poslink` module's callback flavour is the one to read if you are writing Java.
