> For the complete documentation index, see [llms.txt](https://docs.bluzelle.com/developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bluzelle.com/developers/bluzeller2/deploy-your-dapps/blzjava.md).

# Java

&#x20;[![](https://raw.githubusercontent.com/bluzelle/api/master/source/images/Bluzelle%20-%20Logo%20-%20Big%20-%20Colour.png)](https://bluzelle.com/)

**blzjava** is a Java/Android library that can be used to access the Bluzelle database service.

* Build and API [docs](https://github.com/bluzelle/docs.bluzelle.com/tree/9d6e9030f30ff5cb68247d1b3ca53cd1d224e165/blzjava/src/com/bluzelle/README.md)
* Java [docs](https://aqoleg.github.io/blzjava)
* [Examples](https://github.com/bluzelle/docs.bluzelle.com/tree/9d6e9030f30ff5cb68247d1b3ca53cd1d224e165/blzjava/examples/README.md)
* Android [example](https://github.com/bluzelle/docs.bluzelle.com/tree/9d6e9030f30ff5cb68247d1b3ca53cd1d224e165/blzjava/android/README.md)
* [Tests](https://github.com/bluzelle/docs.bluzelle.com/tree/9d6e9030f30ff5cb68247d1b3ca53cd1d224e165/blzjava/test/com/bluzelle/README.md)

## Quickstart

Make sure that Java is installed and has a version at least 8 (JDK 1.8).

```
$ java -version
$ javac -version
```

If Java is not installed, install it.

```
$ sudo apt-get update
$ sudo apt-get install default-jdk
```

Download bluzelle.jar from [releases](https://github.com/bluzelle/blzjava/releases) or using terminal.

```
$ wget https://github.com/bluzelle/blzjava/releases/download/0.0.1/bluzelle.jar
```

Create file "Quickstart.java".

```java
import com.bluzelle.*;

public class Quickstart {

    public static void main(String[] args) {
        Bluzelle bluzelle = Bluzelle.connect(
                "around buzz diagram captain obtain detail salon mango muffin brother morning jeans display attend knife carry green dwarf vendor hungry fan route pumpkin car",
                "http://dev.testnet.public.bluzelle.com:1317",
                null,
                null
        );

        GasInfo gasInfo = new GasInfo(10, 0, 0);
        LeaseInfo leaseInfo = new LeaseInfo(1, 0, 0, 0);

        bluzelle.create("key", "value", gasInfo, leaseInfo);
        System.out.println("created");
        bluzelle.update("key", "new value", gasInfo, leaseInfo);
        System.out.println("updated");
        System.out.println("'key': " + bluzelle.read("key", false));
        bluzelle.delete("key", gasInfo);
        System.out.println("deleted");
    }
}
```

Compile.

```
$ javac -cp ./bluzelle.jar Quickstart.java
```

Run.

```
$ java -cp .:./bluzelle.jar Quickstart
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bluzelle.com/developers/bluzeller2/deploy-your-dapps/blzjava.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
