IntelliJ + Maven

This tutorial provides a beginner-friendly click by click guide to set up Javacord with Intellij and Maven. If you are already familiar with IntelliJ and Maven, you can just see the artifact locations at Download / Installation.


We recommend to use Intellij + Gradle unless you already have experience with one of the other IDEs or build managers.

🔧 Setup

1. Start IntelliJ

2. Create a new project (File -> New -> Project)

3. Select Maven

4. Make sure to select an SDK which is 1.8 (or greater)

5.* Click Next

6. Enter a group id (e.g. com.github.yourname)

7. Enter an artifact id (e.g. myfirstbot)

8. Click Next

9. Click on Finish

10. Your project should now look like this. First click on Enable Auto-Import

11. Now you have to add Javacord as a dependency by editing the pom.xml file. Your file should now look like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""




12. Create a new package

13. Create a new class inside this package

14. You can now start coding! Example code:

package com.github.yourname;

import org.javacord.api.DiscordApi;
import org.javacord.api.DiscordApiBuilder;

public class Main {

    public static void main(String[] args) {
        // Insert your bot's token here
        String token = "your token";

        DiscordApi api = new DiscordApiBuilder().setToken(token).login().join();

        // Add a listener which answers with "Pong!" if someone writes "!ping"
        api.addMessageCreateListener(event -> {
            if (event.getMessageContent().equalsIgnoreCase("!ping")) {

        // Print the invite url of your bot
        System.out.println("You can invite the bot by using the following url: " + api.createBotInvite());

🏃‍♀️ Run the code

You can run your code by clicking on the small green arrow

🚧 Possible problems

Note: If you get the following error:

you have to change your language level to 1.8