---
updatedAt: 2026-08-20T10:52:00.000Z
agentTools:
  projectIndex: https://docs.hud.io/llms.txt
---

# Java Installation

Integrate Hud Java Agent for enhanced observability in your application in a few simple steps

## 1. Create environment variables

Create the following environment variables:

1. `HUD_KEY` - Hud API key, use the key for the relevant environment from [here](https://www.app.hud.io/api-keys)
2. `HUD_SERVICE` - your service name

<br />

## 2. Download the Hud's Jar

Use `curl` to download Hud's Jar.

```
curl -L -o hud-sdk.jar https://github.com/code-hud/java-sdk-releases/releases/latest/download/hud-sdk.jar
```

<details class="Accordion">
  <summary class="Accordion-title">
    <i class="Accordion-toggleIcon fa fa-chevron-right"></i>
    <i class="Accordion-icon fa fa-question-circle"></i>
    How to pin a fixed version?
  </summary>

  <section style="margin-top: 1em;">
    <div style="padding: 0 16px;">
      Browse available versions at <a href="https://github.com/code-hud/java-sdk-releases/releases/">github.com/code-hud/java-sdk-releases/releases</a>, then replace <code>latest</code> with the version tag:

```
curl -L -o hud-sdk.jar https://github.com/code-hud/java-sdk-releases/releases/download/v0.2.x/hud-sdk.jar
```

   </div>
  </section>
</details>

<br />

## 3. Add Hud to your service start command

```Text Java
java -javaagent:./hud-sdk.jar -Dio.hud.includeDomains=[package_name1];[package_name2];... -jar [app.jar]
```

Where:

* `[package_name1];...` are the packages to monitor, and could be just their start, e.g. `companyname`
* `[app.jar]` is your application jar

<br />

## 4. Run your service and trigger it!

**Start your service and trigger the functions you want to measure** - metrics collection will begin automatically.

Then, head over to the [web app](https://www.app.hud.io) to explore your data live.

Need help? Use Hud's Chat with our support team or email us at <support@hud.io> .

<br />