Build distributed applications using the Dapr Java SDK. The Dapr Java SDK provides client libraries and Spring Boot integration to interact with Dapr building blocks and APIs.

## Resources

- [Dapr Java SDK GitHub](https://github.com/dapr/java-sdk)
- [Dapr Java SDK Maven Central](https://search.maven.org/search?q=g:io.dapr)
- [Dapr Java SDK Documentation](https://docs.dapr.io/developing-applications/sdks/java/)

**Prerequisites:**

- JDK 11+ ([Download](https://adoptium.net/))
- Maven 3.x or Gradle 6.x
- [Dapr Java Client/Server SDK](https://search.maven.org/search?q=g:io.dapr)

## Installation

<details>
  <summary>Maven</summary>

  Add the following to your `pom.xml`:

  ```xml
  <dependency>
      <groupId>io.dapr</groupId>
      <artifactId>dapr-sdk</artifactId>
      <version>1.xx.x</version>
  </dependency>
  ```
</details>

<details>
  <summary>Gradle</summary>

  Add the following to your `build.gradle`:

  ```gradle
  dependencies {
      implementation 'io.dapr:dapr-sdk:1.xx.x'
  }
  ```
</details>

:::tip Spring Boot Integration
If you're using Spring Boot, check out the [Spring Boot Integration](https://docs.dapr.io/developing-applications/sdks/java/spring-boot/), which provides Spring Data abstractions, Spring Messaging patterns, and auto-configuration for a more Spring-native development experience.
:::

## Dapr Client APIs

Use the Dapr Client to interact with Dapr building blocks and APIs with Java-specific examples and code samples.

- [State Management](https://docs.dapr.io/developing-applications/sdks/java/java-client/#save--get-application-state) — Store and retrieve application state using key-value pairs with Java code examples
- [Service Invocation](https://docs.dapr.io/developing-applications/sdks/java/java-client/#invoke-a-service) — Invoke methods on other services securely and reliably with Java SDK
- [Publish](https://docs.dapr.io/developing-applications/sdks/java/java-client/#publish-messages) — Publish events to topics for event-driven communication in Java
- [Bindings](https://docs.dapr.io/developing-applications/sdks/java/java-client/#interact-with-output-bindings) — Interact with external systems through input and output bindings using Java
- [Secrets Management](https://docs.dapr.io/developing-applications/sdks/java/java-client/#retrieve-secrets) — Securely retrieve secrets from configured secret stores with Java examples
- [Conversation](https://docs.dapr.io/developing-applications/building-blocks/conversation/howto-conversation-layer/) — Interact with Large Language Models (LLMs) using the Dapr Conversation API with Java

## Dapr Server

Build services that can be invoked by other services and subscribe to topics using Java.

- Service Invocation Server — Create services that can be invoked by other Dapr applications
- [Pub/Sub Subscriptions](https://docs.dapr.io/developing-applications/sdks/java/java-client/#publish--subscribe-to-messages) — Subscribe to topics and handle messages
- [Binding Invocation Handler](https://docs.dapr.io/developing-applications/sdks/java/java-client#interact-with-input-bindings) — Handle input bindings from external systems

## Advanced Features

- [Actors](https://docs.dapr.io/developing-applications/sdks/java/java-client/#actors) — Build virtual actors with state, timers, and reminders using Java SDK
- [Workflow](https://docs.diagrid.io/develop/workflows/java-sdk) — Create durable, long-running workflows with Java code examples
- [Jobs](https://docs.dapr.io/developing-applications/sdks/java/java-jobs/java-jobs-howto/) — Schedule, get, and delete jobs with Java SDK examples
- [Distributed Lock](https://docs.dapr.io/developing-applications/sdks/java/java-client/#distributed-lock) — Acquire and release distributed locks for synchronization with Java
- [Authentication](https://docs.dapr.io/developing-applications/sdks/java/java-client/#security) — Configure API token authentication for Dapr client in Java

## Spring Boot Integration

Leverage the Spring Boot programming model with Dapr using the `dapr-spring-boot-starter` integration. This provides familiar Spring abstractions including:

- **Spring Data Integration**: Use `CrudRepository` and `KeyValueTemplate` for state management
- **Spring Messaging**: Use `DaprMessagingTemplate` and `@Topic` annotations for pub/sub
- **Auto-Configuration**: Automatic bean discovery and dependency injection
- **Testcontainers Support**: Easy testing with integrated Dapr containers

* [Spring Boot Integration Guide](https://docs.dapr.io/developing-applications/sdks/java/spring-boot/) — Learn how to use Spring Data, Spring Messaging, and Dapr Workflows with Spring Boot

## Getting Started

- [Java Examples](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples) — Samples that highlight the Java SDK Capabilities
- [Java Client Documentation](https://docs.dapr.io/developing-applications/sdks/java/java-client/) — Complete Java client SDK guide with code examples

### Catalyst Quickstarts

- [State Quickstart](https://docs.diagrid.io/getting-started/quickstarts/dapr-apis/state) — Get started with state management in Catalyst
- [Pub/Sub Quickstart](https://docs.diagrid.io/getting-started/quickstarts/dapr-apis/pubsub) — Get started with publish and subscribe in Catalyst
- [Service Invocation Quickstart](https://docs.diagrid.io/getting-started/quickstarts/dapr-apis/invocation) — Get started with service invocation in Catalyst
