# jwt.java
**Repository Path**: nats-io/jwt.java
## Basic Information
- **Project Name**: jwt.java
- **Description**: JWT tokens signed using NKeys for Ed25519 for the NATS ecosystem [Java]
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-01-27
- **Last Updated**: 2026-02-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README

# Java JWT Utilities Library
The library provides utilities for reading and creating JWTs used by the NATS server.


[](https://github.com/nats-io/jwt.java/actions/workflows/build-main.yml)
[](https://coveralls.io/github/nats-io/jwt.java?branch=main)
[](http://javadoc.io/doc/io.nats/jwt.java?branch=main)
[](https://www.apache.org/licenses/LICENSE-2.0)
### JDK Version
This project uses Java 8 Language Level api, but builds jars compiled with and targeted for Java 8, 17, 21 and 25.
It creates different artifacts for each. All have the same group id `io.nats` and the same version but have different artifact names.
| Java Target Level | Artifact Id | Maven Central |
|:-----------------:|-------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------:|
| 17 | `jwt-utils-jdk17` | [](https://mvnrepository.com/artifact/io.nats/jwt-utils-jdk17) |
| 21 | `jwt-utils-jdk21` | [](https://mvnrepository.com/artifact/io.nats/jwt-utils-jdk21) |
| 25 | `jwt-utils-jdk25` | [](https://mvnrepository.com/artifact/io.nats/jwt-utils-jdk25) |
### Dependency Management
The NATS client is available in the Maven central repository,
and can be imported as a standard dependency in your `build.gradle` or `pom.xml` file,
The examples shown use the Jdk 8 version. To use other versions, change the artifact id.
#### Gradle
```groovy
dependencies {
implementation 'io.nats:jwt-utils:3.0.0'
}
```
If you need the latest and greatest before Maven central updates, you can use:
```groovy
repositories {
mavenCentral()
maven {
url "https://repo1.maven.org/maven2/"
}
}
```
If you need a snapshot version, you must add the url for the snapshots and change your dependency.
```groovy
repositories {
mavenCentral()
maven {
url "https://central.sonatype.com/repository/maven-snapshots"
}
}
dependencies {
implementation 'io.nats:jwt-utils:3.0.1-SNAPSHOT'
}
```
#### Maven
```xml
io.nats
jwt-utils
3.0.0
```
If you need the absolute latest, before it propagates to maven central, you can use the repository:
```xml
sonatype releases
https://repo1.maven.org/maven2/
true
```
If you need a snapshot version, you must enable snapshots and change your dependency.
```xml
sonatype snapshots
https://central.sonatype.com/repository/maven-snapshots
true
io.nats
jwt-utils
3.0.1-SNAPSHOT
```
## License
Unless otherwise noted, the NATS source files are distributed
under the Apache Version 2.0 license found in the LICENSE file.