# Upgrade Nexus Repository Java Version

**Important**

Starting with Nexus Repository `3.87.0`, Sonatype’s official installers and images include a bundled Java 21 runtime. When you install or upgrade Nexus using Sonatype’s official packages (the default), Nexus will normally run with the bundled Java and you do not need to upgrade the system Java.

This page explains how to upgrade the Java version used by your Nexus Repository instance. Before you begin, review the supported Java versions for your Nexus Repository instance. For details, see the [Java Runtime Compatibility Matrix](https://help.sonatype.com/en/java-compatibility-matrix.html "Java Runtime Compatibility Matrix").

Sonatype provides alternate distribution binaries and configuration for supported Java versions. Before you switch to a different Java version, download the correct distribution.

**Note**

The Java compatibility information applies to external or system Java. If you use the bundled Java runtime included with Nexus Repository 3.87.0 and later, you typically do not need to upgrade the system Java.

Metrics exported from the JVM through the metrics API endpoint and Prometheus can vary between Java versions.

If you use Nexus Repository with Docker images or the Helm chart, the Java version is bundled and managed as part of each Nexus release. In most cases, no additional action is required when you upgrade Nexus Repository. The following sections for Docker and Helm chart deployments are provided for reference if you need to understand or manage Java usage in specific scenarios.

## Upgrade with Docker

Use a Java-specific Nexus Docker tag such as `-java17` only if you require a particular Java runtime.

Official images and installers for Nexus 3.87.0 and later include a bundled Java runtime. In most cases, you do not need to switch tags or upgrade system Java.

For available tags, see [Nexus Repository tags in Docker Hub](https://hub.docker.com/r/sonatype/nexus3/tags).

## Upgrade with the Helm Chart

If you use the Helm chart, set the Java version by updating the `nexusTag` property in the `values.xml` file. Use the available Docker images to set the appropriate tag.

```
container:
  image:
    repository: sonatype/nexus3
    nexusTag: 3.87.0-java17
```

For more information, see the [Helm Chart](https://github.com/sonatype/nxrm3-ha-repository/blob/main/nxrm-ha/values.yaml#L94) documentation.

For Java version compatibility across Nexus releases, see the [Java Runtime Compatibility Matrix](https://help.sonatype.com/en/java-compatibility-matrix.html).

## Upgrading Your Java Version Using the Distribution Archive

Download the archive with the appropriate Java version from [Downloads](https://help.sonatype.com/en/download.html "Download").

The Java SDK is bundled with the software distribution for MacOS, Windows, and Unix systems. The Unix archive includes a platform-specific JDK and cannot be used on macOS.
