> For the complete documentation index, see [llms.txt](https://docs.bosonnetwork.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bosonnetwork.io/build-applications/java-sdk.md).

# Java SDK Setup

The Boson Java SDK is published to **Maven Central** under the group id `io.bosonnetwork`. Every artifact shares one version.

## Requirements

* Java 17 or later
* Maven, Gradle, or any build tool that resolves from Maven Central

The SDK is pure Java and needs no native libraries. Netty's native transport is optional; see [Native Transport](/build-applications/java-sdk/native-transport.md).

***

## Artifacts

Add only what your application uses; each artifact brings in `boson-api`.

| Artifact                    | Provides                                                            | Use it for                                                                 |
| --------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `boson-api`                 | `Node`, `Id`, `Value`, `PeerInfo`, identities and cryptography      | The core types every other artifact builds on                              |
| `boson-dht`                 | The Kademlia DHT node behind `Node.kadNode()`                       | Applications that join the DHT themselves                                  |
| `boson-higgs`               | `HiggsNode`, a `Node` that works through a super node's Web Gateway | JVM applications that should not run a DHT node                            |
| `boson-director-client`     | `DirectorClient`                                                    | Creating an account on a super node, registering devices, profile and plan |
| `boson-messaging-client`    | `MessagingClient`                                                   | Photon Messaging                                                           |
| `boson-ion-store-client`    | `IonStore`                                                          | Ion Store                                                                  |
| `boson-active-proxy-client` | `ActiveProxyClient`                                                 | Active Proxy                                                               |

***

## Add the dependency

{% tabs %}
{% tab title="Maven" %}

```xml
<properties>
    <boson.version>3.2.0</boson.version>
</properties>

<dependencies>
    <dependency>
        <groupId>io.bosonnetwork</groupId>
        <artifactId>boson-dht</artifactId>
        <version>${boson.version}</version>
    </dependency>
</dependencies>
```

{% endtab %}

{% tab title="Gradle" %}

```kotlin
dependencies {
    implementation("io.bosonnetwork:boson-dht:3.2.0")
}
```

{% endtab %}
{% endtabs %}

Keep all Boson artifacts on the same version. See [Release Notes](/resources/changelog.md) for what changed between versions.

### Several artifacts: the bill of materials

`boson-dependencies` is a BOM that pins every Boson artifact, so a project using more than one of them names the version once.

{% tabs %}
{% tab title="Maven" %}

```xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.bosonnetwork</groupId>
            <artifactId>boson-dependencies</artifactId>
            <version>3.2.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>io.bosonnetwork</groupId>
        <artifactId>boson-dht</artifactId>
    </dependency>
    <dependency>
        <groupId>io.bosonnetwork</groupId>
        <artifactId>boson-messaging-client</artifactId>
    </dependency>
</dependencies>
```

{% endtab %}

{% tab title="Gradle" %}

```kotlin
dependencies {
    implementation(platform("io.bosonnetwork:boson-dependencies:3.2.0"))
    implementation("io.bosonnetwork:boson-dht")
    implementation("io.bosonnetwork:boson-messaging-client")
}
```

{% endtab %}
{% endtabs %}

The BOM also pins the third-party versions the SDK is built and tested against - Vert.x, Netty, Jackson and the rest - so importing it keeps an application's transitive versions in step with the SDK's own.

{% hint style="info" %}
A published version resolves from Maven Central immediately and is listed on [central.sonatype.com](https://central.sonatype.com/namespace/io.bosonnetwork). Third-party index sites such as mvnrepository.com lag behind by a day or more; a version missing there is still resolvable.
{% endhint %}

***

## A full node in a few lines

```java
import io.bosonnetwork.*;

NodeConfiguration config = NodeConfiguration.builder()
    .autoHost4()
    .port(39001)
    .privateKey("<Base58 private key>")
    .dataDir("/var/lib/myapp/boson")
    .addBootstrap("FyHfVWtscJWUeejGQaJXyUnjUcKFGSVVYmozqBuJSmjo", "155.138.245.211", 39001)
    .addBootstrap("66yzSu9imYLtG4TWMZKdk79BXGcX17s2b259taYFeyKw", "45.32.138.246", 39001)
    .build();

Node node = Node.kadNode(config);
node.start().get();

// ... use the node ...

node.stop().get();
```

These two are the project's [public bootstrap nodes](/resources/community.md#public-bootstrap-nodes).

***

## What to read next

* [Full Node](/build-applications/java-sdk/full-node.md): configuration and lifecycle
* [Light Node](/build-applications/java-sdk/light-node.md): `HiggsNode` through a Web Gateway
* [Values and Peers](/build-applications/java-sdk/values-and-peers.md): storing and finding data
* [Identity and Keys](/build-applications/java-sdk/identity-keys.md): keys, signing and encryption
* [Service Clients](/build-applications/services.md): messaging, storage, NAT traversal and the Director


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bosonnetwork.io/build-applications/java-sdk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
