> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.cloudquant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Java SDK Getting Started

> Prerequisites and setup guide for using the Java CloudQuant Data Liberator External API.

# Java SDK getting started

The CloudQuant Data Liberator Java SDK uses Apache Arrow for efficient data streaming and provides a generator-based iteration pattern.

## Prerequisites

<CodeGroup>
  ```bash Debian/Ubuntu theme={null}
  sudo apt-get install ca-certificates-java openjdk-17-jdk openjdk-17-jre maven
  ```

  ```bash RHEL/CentOS theme={null}
  sudo dnf install ca-certificates java-17-openjdk java-17-openjdk-devel maven
  ```
</CodeGroup>

Run the `./build_maven.sh` script to build the Maven project and install the project dependencies.

## Required security files

Place the following files from your Downloads ZIP in your working directory:

* **`liberator.json`** — Contains your Username and Token
* **`liberator.pfx`** — Security certificate (only required for releases prior to 2.0)

<Warning>
  `liberator.json` must be in your working directory.
</Warning>

<Note>
  As of release version 2.0, `liberator.pfx` is no longer required. If you are on a release prior to 2.0, you must also include `liberator.pfx` in your working directory.
</Note>

## Quick start

```java theme={null}
Liberator liberator = new Liberator();
Object query_id = liberator.query(new HashMap<>() {{
    put("name", "daily_bars");
    put("as_of", "2020-11-15");
    put("symbols", "AAPL");
}});

for (Liberator.QueryResult res : liberator.Generate()) {
    Object res_id = res.GetId();
    Object data = res.GetData();
    if (data instanceof org.apache.arrow.vector.VectorSchemaRoot) {
        org.apache.arrow.vector.VectorSchemaRoot recordBatch =
            (org.apache.arrow.vector.VectorSchemaRoot) data;
        printRecordBatch(recordBatch);
    } else if (data instanceof javax.json.JsonValue) {
        javax.json.JsonValue jsonValue = (javax.json.JsonValue) data;
        System.out.println(jsonValue);
    }
}
```
