> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-agent/default-usage-cli/downloading-the-java-agent.md).

# Downloading The Java Agent

## Downloading The Latest Version <a href="#downloading-the-latest-agent-version" id="downloading-the-latest-agent-version"></a>

### Agent Files <a href="#agent-files" id="agent-files"></a>

There are two agent files:

* Build Scanner - sl-build-scanner.jar
* Test Listener - sl-test-listener.jar

Download them from: <https://agents.sealights.co/sealights-java/sealights-java-latest.zip>

{% hint style="info" %}
If you want to query the latest version you can do so with the following sample command: `curl https://agents.sealights.co/sealights-java/sealights-java-version.txt`
{% endhint %}

{% hint style="warning" %}
If you have a limitation accessing the endpoint [agents.sealights.co](http://agents.sealights.co/) and are limited to your specific servers DNS, then you can also get the agent from `https://{company}.sealights.co/agents/sealights-java/sealights-java-latest.zip`\
Replace `{company}` with your company DNS prefix.
{% endhint %}

### Sample commands for download <a href="#sample-commands-for-download" id="sample-commands-for-download"></a>

{% tabs %}
{% tab title="Shell" %}
{% code overflow="wrap" lineNumbers="true" %}

```sh
wget -nv https://agents.sealights.co/sealights-java/sealights-java-latest.zip
unzip -oq sealights-java-latest.zip

#curl tool can also be used
#curl -L "https://agents.sealights.co/sealights-java/sealights-java-latest.zip" --output sealights-java-latest.zip
```

{% endcode %}
{% endtab %}

{% tab title="Powershell 5+" %}
{% code overflow="wrap" lineNumbers="true" %}

```powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
iwr https://agents.sealights.co/sealights-java/sealights-java-latest.zip  -OutFile sealights-java-latest.zip -ErrorAction Continue
if (Test-Path -Path sealights-java-latest.zip -PathType Leaf) {
  Expand-Archive .\sealights-java-latest.zip
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Downloading the Specific Version Defined in Customer Settings <a href="#downloading-the-specific-agent-version-defined-in-customer-settings" id="downloading-the-specific-agent-version-defined-in-customer-settings"></a>

Existing Customers can also download agents using the API below, which requires the use of an Agent or API token from the customer's SeaLights dashboard. For Customers that need to set a specific recommended agent version other than the default latest, the API will download the recommended agent that has been set on the dashboard.

{% hint style="info" %}
In the following examples, replace `$DOMAIN` with your domain and `$SL_TOKEN` with your SeaLights agent token
{% endhint %}

{% code overflow="wrap" lineNumbers="true" %}

```sh
wget -nv -O sealights-java-agents.zip --header "accept: application/json" --header "Authorization: Bearer $SL_TOKEN" https://$DOMAIN/api/v2/agents/sealights-java/recommended/download 
#curl tool can also be used
#curl -X GET "https://$DOMAIN/api/v2/agents/sealights-java/recommended/download" -H "accept: application/json" -H "Authorization: Bearer $SL_TOKEN" -L --output sealights-java-agents.zip

unzip -oq sealights-java-agents.zip
```

{% endcode %}

### Downloading a single agent from a local repo <a href="#downloading-a-single-agent-from-a-local-repo" id="downloading-a-single-agent-from-a-local-repo"></a>

In certain cases where you want to download just a single agent, or even if you want to download both from a local repo, you can use the SeaLights API to get the recommended version and then download the file directly.

{% hint style="info" %}
In the example below, replace `$DOMAIN` with your domain and `$SL_TOKEN` with your SeaLights agent token and the repo URL to your internal one.\
Currently, the lines below download the Java agents (scanner and listener) from Maven Central.
{% endhint %}

{% code overflow="wrap" lineNumbers="true" %}

```sh
#!/bin/bash
AGENT_VERSION=$(curl -s -X GET "https://$DOMAIN/sl-api/v1/agent-apis/agents/types/sealights-java/default-version"  -H "accept: application/json" -H "Authorization: Bearer $SL_TOKEN" | jq -r .version)
# Loop over the two agent artifact names and download each
for artifact in sl-build-scanner sl-test-listener; do
    wget -O "${artifact}.jar" "https://oss.sonatype.org/service/local/repositories/releases/content/io/sealights/on-premise/agents/${artifact}/${AGENT_VERSION}/${artifact}-${AGENT_VERSION}.jar"
done
#curl tool can also be used
#curl -L -o "${artifact}.jar" "https://oss.sonatype.org/service/local/repositories/releases/content/io/sealights/on-premise/agents/${artifact}/${AGENT_VERSION}/${artifact}-${AGENT_VERSION}.jar"
```

{% endcode %}

### Managing the recommended agent version <a href="#managing-the-recommended-agent-version" id="managing-the-recommended-agent-version"></a>

The agent version can be managed via the dashboard under the `Settings > Cockpit & Onboarding > Agent Versions` section below.

<figure><img src="https://4057366433-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAjqTCMRYvHhDgsdPLUnc%2Fuploads%2Fsq7CuCgxxN2uKWlHoMtd%2FScreenshot%202025-06-24%20at%2013.45.51.png?alt=media&amp;token=4b3ec850-e73b-484a-8b0a-30c92ab73cd2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please refer to the following troubleshooting page to manage/update agents versions deployed locally: [Keeping Your Agent Updated](/knowledgebase/setup-and-configuration/troubleshooting-faq/java/keeping-your-agent-updated.md).
{% endhint %}


---

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-agent/default-usage-cli/downloading-the-java-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
