---
title: "Java"
description: "Official Java client library documentation for integrating Weaviate with Java applications and services."
url: https://docs.weaviate.io/weaviate/client-libraries/java
---

# Java

> [!NOTE]
>
> **Java client v6**
>
> We have officially released the new `Java v6` client.
>
> The v6 client introduces fundamental changes compared to the previous [v5 client](https://docs.weaviate.io/weaviate/client-libraries/java#java-client-v5-deprecation) API. We suggest switching to the v6 client as the v5 client is deprecated.

> [!NOTE]
>
> **Java v6 client (SDK)**
>
> The latest Java v6 client is version `v6.3.1`.
>
> [weaviate/java-client](https://github.com/weaviate/java-client/)[Reference manual](https://javadoc.io/doc/io.weaviate/client6/latest/index.html)

This page broadly covers the Weaviate Java client (`v6` release). For usage information not specific to the Java client, such as code examples, see the relevant pages in the [How-to manuals & Guides](https://docs.weaviate.io/weaviate/guides).

## Installation

```xml
<dependency>
    <groupId>io.weaviate</groupId>
    <artifactId>client6</artifactId>
    <version>6.3.1</version>
</dependency>
```

**Uber JAR🫙**

If you're building an uber-JAR with something like `maven-assembly-plugin`, use a shaded version with classifier `all`. This ensures that all dynamically-loaded dependencies of `io.grpc` are resolved correctly.

```xml
<dependency>
    <groupId>io.weaviate</groupId>
    <artifactId>client6</artifactId>
    <version>6.3.1</version>
    <classifier>all</classifier>
</dependency>
```

**Requirements: Weaviate version compatibility & gRPC**

#### Weaviate version compatibility

The `v6` Java client requires Weaviate `v1.32.0` and later. Generally, we encourage you to use the latest version of the Java client and the Weaviate Database.

#### gRPC

The `v6` client uses remote procedure calls (RPCs) under-the-hood. Accordingly, a port for gRPC must be open to your Weaviate server.

**docker-compose.yml example**

If you are running Weaviate with Docker, you can map the default port (`50051`) by adding the following to your `docker-compose.yml` file:

```yaml
ports:
  - 8080:8080
  - 50051:50051
```

## Get started

> [!TIP]
>
> **Prerequisites**
>
> If you haven't yet, we recommend going through the [**Quickstart tutorial**](https://docs.weaviate.io/weaviate/quickstart) first to get the most out of this section.

Get started with Weaviate using this Java example. The code walks you through these key steps:

1. **[Connect to Weaviate](https://docs.weaviate.io/weaviate/connections)**: Establish a connection to a local (or Cloud) Weaviate instance.
2. **[Create a collection](https://docs.weaviate.io/weaviate/manage-collections)**: Define the data schema for a `Question` collection, using an Ollama model to vectorize the data.
3. **[Import data](https://docs.weaviate.io/weaviate/manage-objects/import)**: Fetch sample Jeopardy questions and use Weaviate's batch import for efficient ingestion and automatic vector embedding generation.
4. **[Search/query the database](https://docs.weaviate.io/weaviate/search)**: Execute a vector search to find questions semantically similar to the query `biology`.

**Java**

```java
  // Connect to a local Weaviate instance
  client = WeaviateClient.connectToLocal();
  if (client.collections.exists(collectionName)) {
    client.collections.delete(collectionName);
  }

  // Create a collection with
  client.collections.create(
      collectionName,
      col -> col.properties(Property.text("answer"),
          Property.text("question"),
          Property.text("category"))
          .vectorConfig(VectorConfig.text2vecOllama(v -> v
              // If using Docker you might need: http://host.docker.internal:11434
              .apiEndpoint("http://ollama:11434")
              .model("nomic-embed-text") // The model to use
          )) // Configure the Ollama embedding model
  );
  CollectionHandle<Map<String, Object>> questions = client.collections.use(collectionName);

  HttpClient httpClient = HttpClient.newHttpClient();
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI
          .create("https://raw.githubusercontent.com/weaviate-tutorials/quickstart/main/data/jeopardy_tiny.json"))
      .build();
  HttpResponse<String> responseHttp = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
  String responseBody = responseHttp.body();

  ObjectMapper objectMapper = new ObjectMapper();
  List<Map<String, String>> data = objectMapper.readValue(responseBody, new TypeReference<>() {
  });

  // Create a list to hold the objects for insertion
  List<Map<String, Object>> questionsToInsert = new ArrayList<>();

  // Populate the list with the data
  for (Map<String, String> d : data) {
    Map<String, Object> properties = new HashMap<>();
    properties.put("answer", d.get("Answer"));
    properties.put("question", d.get("Question"));
    properties.put("category", d.get("Category"));
    questionsToInsert.add(properties);
  }

  // Call insertMany with the list of objects
  InsertManyResponse insertResponse = questions.data.insertMany(questionsToInsert.toArray(new Map[0]));

  // Check for errors
  if (!insertResponse.errors().isEmpty()) {
    System.err.println("Errors during insertMany: " + insertResponse.errors());
  }

  // Perform a vector similarity search
  var queryResponse = questions.query.nearText("biology", q -> q.limit(2));

  for (var obj : queryResponse.objects()) {
    System.out.println(obj.properties());
  }
```

For more code examples, check out the [How-to manuals & Guides](https://docs.weaviate.io/weaviate/guides) section.

## Asynchronous usage

The client has an asynchronous API. Call `client.async()` to get a [`WeaviateClientAsync`](https://javadoc.io/doc/io.weaviate/client6/latest/io/weaviate/client6/v1/api/WeaviateClientAsync.html), which mirrors the synchronous API without blocking:

```java
var client = WeaviateClient.connectToLocal();

try (final var async = client.async()) {
    async.collections.create("Things");
}

client.close();
```

If you only need the asynchronous API, create it directly with one of the `WeaviateClientAsync` static factories (`connectToLocal`, `connectToWeaviateCloud`, `connectToCustom`) instead. That way the client does not initialize resources it never uses.

## Releases

Go to the [GitHub releases page](https://github.com/weaviate/java-client/releases) to see the history of the Java client library releases and change logs.

**Click here for a table of Weaviate and corresponding client versions**

This table lists recent Weaviate Database versions and corresponding client library versions.

| Weaviate Database ([GitHub](https://github.com/weaviate/weaviate/releases)) | First release date | Python ([GitHub](https://github.com/weaviate/weaviate-python-client/releases)) | TypeScript/ JavaScript ([GitHub](https://github.com/weaviate/typescript-client/releases)) | Go ([GitHub](https://github.com/weaviate/weaviate-go-client/releases)) | Java ([GitHub](https://github.com/weaviate/java-client/releases)) | C# ([GitHub](https://github.com/weaviate/csharp-client/releases)) |
| - | - | - | - | - | - | - |
| [1.40.x](https://github.com/weaviate/weaviate/releases/tag/v1.40.0) | 2026-10-07 | [4.24.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.24.0) | [3.15.x](https://github.com/weaviate/typescript-client/releases/tag/v3.15.1) | [6.0.0](https://github.com/weaviate/weaviate-go-client/releases/tag/v6.0.0) | [6.3.2](https://github.com/weaviate/java-client/releases/tag/6.3.2) | - |
| [1.39.x](https://github.com/weaviate/weaviate/releases/tag/v1.39.0) | 2026-08-04 | [4.23.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.23.0) | [3.15.x](https://github.com/weaviate/typescript-client/releases/tag/v3.15.0) | - | [6.3.1](https://github.com/weaviate/java-client/releases/tag/6.3.1) | [1.2.0](https://github.com/weaviate/csharp-client/releases/tag/1.2.0) |
| [1.38.x](https://github.com/weaviate/weaviate/releases/tag/v1.38.0) | 2026-06-05 | [4.22.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.22.0) | [3.14.x](https://github.com/weaviate/typescript-client/releases/tag/v3.14.0) | - | [6.3.0](https://github.com/weaviate/java-client/releases/tag/6.3.0) | [1.2.0](https://github.com/weaviate/csharp-client/releases/tag/1.2.0) |
| [1.37.x](https://github.com/weaviate/weaviate/releases/tag/v1.37.0) | 2026-04-16 | [4.21.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.21.0) | [3.13.x](https://github.com/weaviate/typescript-client/releases/tag/v3.13.0) | [5.7.3](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.7.3) | [6.2.0](https://github.com/weaviate/java-client/releases/tag/6.2.0) | [1.1.1](https://github.com/weaviate/csharp-client/releases/tag/1.1.1) |
| [1.36.x](https://github.com/weaviate/weaviate/releases/tag/v1.36.0) | 2026-02-24 | [4.20.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.20.0) | [3.12.x](https://github.com/weaviate/typescript-client/releases/tag/v3.12.0) | [5.7.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.7.0) | [6.1.0](https://github.com/weaviate/java-client/releases/tag/6.1.0) | [1.0.1](https://github.com/weaviate/csharp-client/releases/tag/1.0.1) |

**Older releases**

| Weaviate Database ([GitHub](https://github.com/weaviate/weaviate/releases)) | First release date | Python ([GitHub](https://github.com/weaviate/weaviate-python-client/releases)) | TypeScript/ JavaScript ([GitHub](https://github.com/weaviate/typescript-client/releases)) | Go ([GitHub](https://github.com/weaviate/weaviate-go-client/releases)) | Java ([GitHub](https://github.com/weaviate/java-client/releases)) | C# ([GitHub](https://github.com/weaviate/csharp-client/releases)) |
| - | - | - | - | - | - | - |
| [1.35.x](https://github.com/weaviate/weaviate/releases/tag/v1.35.0) | 2025-12-17 | [4.19.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.19.0) | [3.11.x](https://github.com/weaviate/typescript-client/releases/tag/v3.11.0) | [5.6.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.6.0) | [6.0.0](https://github.com/weaviate/java-client/releases/tag/6.0.0) | [1.0.0](https://github.com/weaviate/csharp-client/releases/tag/1.0.0) |
| [1.34.x](https://github.com/weaviate/weaviate/releases/tag/v1.34.0) | 2025-11-05 | [4.18.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.18.0) | [3.10.x](https://github.com/weaviate/typescript-client/releases/tag/v3.10.0) | [5.6.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.6.0) | [6.0.0](https://github.com/weaviate/java-client/releases/tag/6.0.0) | - |
| [1.33.x](https://github.com/weaviate/weaviate/releases/tag/v1.33.0) | 2025-09-25 | [4.17.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.17.0) | [3.9.x](https://github.com/weaviate/typescript-client/releases/tag/v3.9.0) | [5.5.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.5.0) | [5.5.x](https://github.com/weaviate/java-client/releases/tag/5.5.0) | - |
| [1.32.x](https://github.com/weaviate/weaviate/releases/tag/v1.32.0) | 2025-07-14 | [4.16.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.16.0) | [3.8.x](https://github.com/weaviate/typescript-client/releases/tag/v3.8.0) | [5.3.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.3.0) | [5.4.x](https://github.com/weaviate/java-client/releases/tag/5.4.0) | - |
| [1.31.x](https://github.com/weaviate/weaviate/releases/tag/v1.31.0) | 2025-05-30 | [4.15.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.15.0) | [3.6.x](https://github.com/weaviate/typescript-client/releases/tag/v3.6.0) | [5.2.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.2.0) | [5.3.x](https://github.com/weaviate/java-client/releases/tag/5.3.0) | - |
| [1.30.x](https://github.com/weaviate/weaviate/releases/tag/v1.30.0) | 2025-04-03 | [4.12.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.12.0) | [3.5.x](https://github.com/weaviate/typescript-client/releases/tag/v3.5.0) | [5.1.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.1.0) | [5.2.x](https://github.com/weaviate/java-client/releases/tag/5.2.0) | - |
| [1.29.x](https://github.com/weaviate/weaviate/releases/tag/v1.29.0) | 2025-02-17 | [4.11.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.11.0) | [3.4.x](https://github.com/weaviate/typescript-client/releases/tag/v3.4.0) | [5.0.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v5.0.0) | [5.1.x](https://github.com/weaviate/java-client/releases/tag/5.1.0) | - |
| [1.28.x](https://github.com/weaviate/weaviate/releases/tag/v1.28.0) | 2024-12-11 | [4.10.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.10.0) | [3.3.x](https://github.com/weaviate/typescript-client/releases/tag/v3.3.0) | [4.16.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v4.16.0) | [5.0.x](https://github.com/weaviate/java-client/releases/tag/5.0.0) | - |
| [1.27.x](https://github.com/weaviate/weaviate/releases/tag/v1.27.0) | 2024-10-16 | [4.9.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.9.0) | [3.2.x](https://github.com/weaviate/typescript-client/releases/tag/v3.2.0) | [4.16.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v4.16.0) | [5.0.x](https://github.com/weaviate/java-client/releases/tag/5.0.0) [4.9.x](https://github.com/weaviate/java-client/releases/tag/4.9.0) | - |
| [1.26.x](https://github.com/weaviate/weaviate/releases/tag/v1.26.0) | 2024-07-22 | [4.7.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.7.0) | [3.1.x](https://github.com/weaviate/typescript-client/releases/tag/v3.1.0) | [4.15.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v4.15.0) | [4.8.x](https://github.com/weaviate/java-client/releases/tag/4.8.0) | - |
| [1.25.x](https://github.com/weaviate/weaviate/releases/tag/v1.25.0) | 2024-05-10 | [4.6.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.6.0) | [2.1.x](https://github.com/weaviate/typescript-client/releases/tag/v2.1.0) | [4.13.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v4.13.0) | [4.6.x](https://github.com/weaviate/java-client/releases/tag/4.6.0) | - |
| [1.24.x](https://github.com/weaviate/weaviate/releases/tag/v1.24.0) | 2024-02-27 | [4.5.x](https://github.com/weaviate/weaviate-python-client/releases/tag/v4.5.0) | [2.0.x](https://github.com/weaviate/typescript-client/releases/tag/v2.0.0) | [4.10.x](https://github.com/weaviate/weaviate-go-client/releases/tag/v4.10.0) | [4.4.x](https://github.com/weaviate/java-client/releases/tag/4.4.0) | - |
| 1.23.x | 2023-12-18 | 3.26.x | 1.5.x | 4.10.x | 4.4.x | - |
| 1.22.x | 2023-10-27 | 3.25.x | 1.5.x | 4.10.x | 4.3.x | - |
| 1.21.x | 2023-08-17 | 3.22.x | 1.4.x | 4.9.x | 4.2.x | - |
| 1.20.x | 2023-07-06 | 3.22.x | 1.1.x | 4.7.x | 4.2.x | - |
| 1.19.x | 2023-05-04 | 3.17.x | 1.1.x[1](https://docs.weaviate.io/weaviate/client-libraries/java#typescript-client-change) | 4.7.x | 4.0.x | - |
| 1.18.x | 2023-03-07 | 3.13.x | 2.14.x | 4.6.x | 3.6.x | - |
| 1.17.x | 2022-12-20 | 3.9.x | 2.14.x | 4.5.x | 3.5.x | - |
| 1.16.x | 2022-10-31 | 3.8.x | 2.13.x | 4.4.x | 3.4.x | - |
| 1.15.x | 2022-09-07 | 3.6.x | 2.12.x | 4.3.x | 3.3.x | - |
| 1.14.x | 2022-07-07 | 3.6.x | 2.11.x | 4.2.x | 3.2.x | - |
| 1.13.x | 2022-05-03 | 3.4.x | 2.9.x | 4.0.x | 2.4.x | - |
| 1.12.x | 2022-04-05 | 3.4.x | 2.8.x | 3.0.x | 2.3.x | - |
| 1.11.x | 2022-03-14 | 3.2.x | 2.7.x | 2.6.x | 2.3.x | - |
| 1.10.x | 2022-01-27 | 3.1.x | 2.5.x | 2.4.x | 2.1.x | - |
| 1.9.x | 2021-12-10 | 3.1.x | 2.4.x | 2.4.x | 2.1.x | - |
| 1.8.x | 2021-11-30 | 3.1.x | 2.4.x | 2.3.x | 1.1.x | - |
| 1.7.x | 2021-09-01 | 3.1.x | 2.4.x | 2.3.x | 1.1.x | - |
| 1.6.x | 2021-08-11 | 2.4.x | 2.3.x | 2.2.x | 1.0.x | - |
| 1.5.x | 2021-07-13 | 2.2.x | 2.1.x | 2.1.x | 1.0.x | - |
| 1.4.x | 2021-06-09 | 2.2.x | 2.1.x | 2.1.x | 1.0.x | - |
| 1.3.x | 2021-04-23 | 2.2.x | 2.1.x | 2.1.x | 1.0.x | - |
| 1.2.x | 2021-03-15 | 2.2.x | 2.0.x | 1.1.x | - | - |
| 1.1.x | 2021-02-10 | 2.1.x | - | - | - | - |
| 1.0.x | 2021-01-14 | 2.0.x | - | - | - | - |

#### TypeScript client change

The [TypeScript client](https://github.com/weaviate/typescript-client) replaced the [JavaScript client](https://github.com/weaviate/weaviate-javascript-client) on 2023-03-17.

#### Java client `v5` deprecation

The Weaviate Java client `v5` has been deprecated and should no longer be used. If you need documentation for the `v5` client, see the [documentation archive](https://archive.docs.weaviate.io/weaviate/client-libraries/java).

## Code examples & further resources

Usage information for various operations and features can be found throughout the Weaviate documentation.



[How-to: Configure Weaviate](https://docs.weaviate.io/weaviate/configuration): Configure compression, backups, authentication, authorization, data replication and more.

[How-to: Manage collections](https://docs.weaviate.io/weaviate/manage-collections): Manage collections (CRUD), configure vectorizers and index parameters, set up multi-tenancy, and perform migrations.

[How-to: Manage objects](https://docs.weaviate.io/weaviate/manage-objects): Adding new objects, fetching existing ones, modifying them, and removing them from collections.

[How-to: Query & search](https://docs.weaviate.io/weaviate/search): From basic vector and hybrid searches to specialized image queries and performing data aggregations.



The Weaviate API reference pages for [search](https://docs.weaviate.io/weaviate/api) and [REST](https://docs.weaviate.io/weaviate/api/rest) may also be useful starting points.
