---
title: "Announcing the Java SDK"
slug: announcing-the-java-sdk
description: "Now you can send emails using the official Resend SDK for Java apps."
created_at: "2023-09-25"
updated_at: "2024-11-28"
image: https://cdn.resend.com/posts/announcing-the-java-sdk.jpg
humans: ["kewyn-akshlley"]
---

In the world of object-oriented programming, the quality of the developer experience with SDKs depends on the freedom users have to customize and extend the existing features to suit their needs. The more space for creativity they have, the better.

So, to provide a unique experience sending emails, managing domains and API keys using the JVM (Java Virtual Machine), we developed a Java SDK to expand the capabilities and features of Resend.

## Getting started

To install the Resend Java SDK, add the following dependency to your project:

_Gradle:_

```bash
implementation 'com.resend:resend-java:2.0.0'
```

_Maven:_

```xml
<dependency>
    <groupId>com.resend</groupId>
    <artifactId>resend-java</artifactId>
    <version>2.0.0</version>
</dependency>
```

Construct your email and easily send it by using our client;

```java
package com.resend;

import com.resend.*;

public class Main {
    public static void main(String[] args) {
        String apiKey = "re_xxxxxxxxx";

        Resend client = new Resend(apiKey);

        SendEmailRequest sendEmailRequest = SendEmailRequest.builder()
            .from("Acme <onboarding@resend.dev>")
            .to("delivered@resend.dev")
            .subject("Hello World")
            .html("<strong>It works!</strong>")
            .build();

        SendEmailResponse data = client.emails().send(sendEmailRequest);

        System.out.println(data.getId());
    }
}
```

You can also create new Domains with the Java SDK.

```java
package com.resend;

import com.resend.*;

public class Main {
    public static void main(String[] args) {
        String apiKey = "re_xxxxxxxxx";

        Resend client = new Resend(apiKey);

        CreateDomainRequest params = CreateDomainRequest
                .builder()
                .name("example.com").build();

        CreateDomainResponse domain = client.domains().create(params);
        System.out.println(domain.getId());
    }
}
```

To learn more, take a look in the [documentation](https://resend.com/docs/send-with-java) and try the [full example](https://github.com/resend/resend-java-example).

If you would like to contribute to the Java SDK, check out the [Github repository](https://github.com/resend/resend-java) .

## Next steps

In the future, we aim to expand our capabilities by incorporating additional JVM languages like Kotlin and creating a reactive version of the library to handle Mono and Flux data types.
