Library / SDK
discord-jda/JDA avatar
discord-jda/JDA

JDA: a Java wrapper for the Discord gateway and REST API

Java wrapper for the popular chat & VOIP service: Discord https://discord.com

4,693 stars758 forksJavaApache-2.0

At a glance

What is it?
JDA is an Apache-2.0 Java library for building Discord bots on the real-time gateway and REST API. It gives you an event system, automatic rate-limit handling and a configurable cache, and it is the right tool when your bot is a long-running JVM service rather than a script.
Who is it for?
Adopt JDA when your Discord bot is a long-running JVM service that needs sharding, a configurable member cache and automatic rate-limit handling, and when you are willing to enable privileged intents in the Discord Application Dashboard. Do not adopt it for a one-off script in another language, or if you expect audio playback to work without adding a DAVE Protocol implementation.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 10 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What JDA solves for Java bot developers

Discord exposes two surfaces: a real-time gateway over a WebSocket and a REST API for actions. A bot that talks to both directly has to maintain the gateway connection, resume it after a disconnect, decode dispatch payloads, and obey rate limits that Discord imposes per route and per bucket. JDA is a Java wrapper over both surfaces, and the README frames the goal as implementing "bots of any kind, allowing for effective and scalable applications."

The intended audience is JVM developers. The README states the minimum supported version is Java SE 8, and that JDA uses JSR 305 for interoperability with Kotlin. A team that already ships Java services can keep its existing build, logging and deployment tooling instead of running a separate Node or Python process next to the JVM. The library is not a bot framework with a command parser or a plugin loader; it is the protocol layer plus a cache, and command routing is left to you.

Event system, REST actions and the cache trade-off

The README names three core concepts. The event system turns gateway dispatch payloads into typed events so you can respond to platform activity in real time. REST actions cover the API calls, and the README says you can choose between "callbacks with combinators, futures, and blocking" for the same operation, while the library handles Discord's rate limits automatically and still lets you replace the default implementation.

The third concept is the cache, described as "trading memory usage for better performance where necessary, with sane default presets to choose from and customize." That trade-off is the part worth thinking about before you write code, because the presets differ sharply. According to the README, JDABuilder.createDefault enables the cache for users active in voice channels plus all cache flags; createLight disables all user cache and cache flags; and create enables member chunking, caches all users and enables all cache flags. Member chunking means the bot requests the full member list of each guild it joins, which is exactly what you want for a moderation bot that resolves mentions offline, and exactly what you do not want for a large public bot that only reacts to messages.

For growth beyond a single gateway connection, the README points at DefaultShardManagerBuilder alongside JDABuilder, and describes JDABuilder as "the intended entry point for smaller bots that don't intend to grow to thousands of guilds." That sentence is the clearest architectural boundary in the documentation.

Installing JDA and running a first message logger

JDA is published on Maven Central, and the README says the latest version is always shown in the GitHub Release. Add the dependency to your build. The Gradle snippet below is the one from the README, with $version standing in for the release you pick.

gradle
repositories {
    mavenCentral()
}

dependencies {
    implementation("net.dv8tion:JDA:$version") { // replace $version with the latest version
    }
}

Maven users get the same artifact coordinates: groupId net.dv8tion, artifactId JDA. Before the bot can log in, you need an application and a bot token from the Discord Application Dashboard; the README links a step-by-step guide for that on the wiki.

The README's message-logging example is the smallest real use. It starts the bot with JDABuilder.createLight and only the two intents it needs:

java
public static void main(String[] args) {
  JDABuilder.createLight(token, EnumSet.of(GatewayIntent.GUILD_MESSAGES, GatewayIntent.MESSAGE_CONTENT))
      .addEventListeners(new MessageReceiveListener())
      .build();
}

The listener extends ListenerAdapter and overrides the message-received method; the README's excerpt cuts off at the class declaration. One thing to note before you run it: the README marks GatewayIntent.MESSAGE_CONTENT as a privileged intent that "must be explicitly enabled in your application dashboard." If you skip that toggle the bot connects but sees no message text. If you want audio, the README adds a separate requirement: a dependency implementing the DAVE Protocol, with the music-bot wiki page as the pointer.

Where JDA is the wrong tool

The first limitation is the one the README states outright: JDABuilder suits bots that will not grow to thousands of guilds, and sharding is a separate builder. If you know from day one that your bot will be in tens of thousands of guilds, starting on JDABuilder means a migration later, because DefaultShardManagerBuilder is a different entry point with a different lifecycle.

The second is audio. The README does not present audio as part of the base dependency. It says you must also add a dependency that implements the DAVE Protocol, and it points at the wiki page on making a music bot. The two audio modules, opus-java and tink, are described as optional exclusions for people who do not need encoding or encryption, which means they are pulled in by default and add jar size for bots that never touch voice.

The third is the intent model itself. Several capabilities are gated behind privileged intents that a human has to enable per application, so a bot that reads message content cannot be deployed purely from a CI pipeline. Finally, JDA is Java-only. A team whose services are in Go or TypeScript gains nothing from the wrapper and pays for a second runtime.

How JDA differs from Discord4J and discord.js

Discord4J targets the same Java and Discord combination, and the difference is visible in the API style. Discord4J is built on Project Reactor, so every REST call returns a Mono or Flux and composition happens through reactive operators. JDA's README describes a different choice: callbacks with combinators, futures, and blocking, all available for the same action. If your codebase is already reactive, Discord4J's model fits it without a translation layer; if it is ordinary imperative Java, JDA's futures and blocking calls avoid dragging a reactive runtime into a small bot.

Against discord.js, the split is the runtime rather than the API. discord.js is the JavaScript wrapper for the same gateway and REST endpoints, and it is the shorter path if your deployment is already Node. Choosing JDA means choosing the JVM: Java SE 8 as the floor, JSR 305 annotations for Kotlin interop, and the Gradle or Maven build you already have. Neither difference makes one library more correct; they decide which existing tooling you keep.

Maintenance, licensing and upgrade cost

The repository is not archived, and the last push was on 2026-09-20. Recent releases follow a steady cadence: v6.5.0 on 2026-07-05, v6.6.0 on 2026-09-06, and v6.7.0 on 2026-09-20, whose release title mentions channel obfuscation. The release titles are a useful signal about what upgrading buys you, since v6.5.0 is labelled with the Message Search API and v6.7.0 with channel obfuscation, both changes that follow Discord platform behaviour rather than the library's own API design.

The licence is Apache-2.0, and the README links to the LICENSE file in the repository. Apache-2.0 permits commercial and closed-source use and includes a patent grant; it also requires that you keep the licence and notice files with redistributed code. That is a description of the licence text, not legal advice, and if you redistribute a modified JDA inside a product, have counsel read the NOTICE requirements.

Upgrade cost is the part the README does not document. There is no migration guide in the repository, so the practical check before bumping a major version is the release notes and the Javadocs. Because JDA tracks Discord's API, a platform change can force a library upgrade on Discord's schedule rather than yours.

Editorial conclusion

Adopt JDA when your Discord bot is a long-running JVM service that needs sharding, a configurable member cache and automatic rate-limit handling, and when you are willing to enable privileged intents in the Discord Application Dashboard. Do not adopt it for a one-off script in another language, or if you expect audio playback to work without adding a DAVE Protocol implementation. Before writing bot logic, verify three things: that your build resolves net.dv8tion:JDA from Maven Central at the version you pinned, that the intents you pass to JDABuilder.createLight are actually enabled in your application dashboard, and whether you need opus-java and tink for audio, since the README says those two modules can be excluded to shrink the jar.

Frequently asked questions

What does JDA stand for in Java?

The README expands the name in its heading: JDA (Java Discord API). It is a Java wrapper for the Discord gateway and REST API, published as net.dv8tion:JDA.

Can I write Discord bots in Java?

Yes. JDA is an open source Java library for implementing bots on Discord using the real-time gateway and REST API, with Java SE 8 as the minimum supported version.

How do I add JDA to a Maven or Gradle project?

The README gives both. With Gradle you add mavenCentral() to repositories and implementation("net.dv8tion:JDA:$version") to dependencies; with Maven the coordinates are groupId net.dv8tion, artifactId JDA. The README says the latest version is always shown in the GitHub Release.

Do I need privileged intents for a JDA bot to read messages?

Yes, for message content. The README marks GatewayIntent.MESSAGE_CONTENT as a privileged intent that must be explicitly enabled in your application dashboard, and its message-logging example passes both GatewayIntent.GUILD_MESSAGES and GatewayIntent.MESSAGE_CONTENT to JDABuilder.createLight.

Does JDA support audio playback out of the box?

Not by itself. The README states that to use JDA for audio connections you must also add a dependency that implements the DAVE Protocol, and points to the wiki page on making a music bot. The opus-java and tink modules are described as optional exclusions for bots that do not need audio.

Official sources

  1. discord-jda/JDA on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/discord-jda-jda.svg)](https://hysenlabs.com/projects/discord-jda-jda)