Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException: net.dv8tion.jda.api.entities.GuildChannel #2670

Closed
2 tasks done
ERmak148 opened this issue May 1, 2024 · 2 comments
Closed
2 tasks done

ClassNotFoundException: net.dv8tion.jda.api.entities.GuildChannel #2670

ERmak148 opened this issue May 1, 2024 · 2 comments

Comments

@ERmak148
Copy link

ERmak148 commented May 1, 2024

General Troubleshooting

  • I have checked for similar issues on the Issue-tracker.
  • I have checked for PRs that might already address this issue.

Version of JDA

v5.0.0-beta.23

Expected Behaviour

JDA should work

Code Example for Reproduction Steps

package org.example;


import com.jagrosh.jdautilities.command.CommandClient;
import com.jagrosh.jdautilities.command.CommandClientBuilder;
import com.jagrosh.jdautilities.commons.waiter.EventWaiter;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
import org.example.commands.HelloWorld;

// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
public class Main {
    public static void main(String[] args) {
        EventWaiter waiter = new EventWaiter();

        CommandClient commandClient = new CommandClientBuilder()
                .setPrefix("..")
                .addCommand(new HelloWorld())
                .build();
        JDA bot = JDABuilder.createDefault("dinahu")
                .addEventListeners(commandClient, waiter)
                .build();

    }
}


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.example</groupId>
    <artifactId>MyDiscordBot1</artifactId>
    <version>1.0-SNAPSHOT</version>
    <repositories>
        <repository>
            <id>central</id>
            <name>bintray</name>
            <url>https://jcenter.bintray.com</url>
        </repository>
    </repositories>
    <properties>
        <maven.compiler.source>20</maven.compiler.source>
        <maven.compiler.target>20</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>5.0.0-beta.23</version>
        </dependency>
        <dependency>
            <groupId>com.jagrosh</groupId>
            <artifactId>jda-utilities</artifactId>
            <version>3.0.2</version>
            <scope>compile</scope>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.13</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>2.0.13</version>
        </dependency>


    </dependencies>

</project>

Code for JDABuilder or DefaultShardManagerBuilder used

JDA bot = JDABuilder.createDefault("token")
                .addEventListeners(commandClient, waiter)
                .build();

Exception or Error

Exception in thread "main" java.lang.NoClassDefFoundError: net/dv8tion/jda/api/entities/GuildChannel
	at org.example.Main.main(Main.java:17)
Caused by: java.lang.ClassNotFoundException: net.dv8tion.jda.api.entities.GuildChannel
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 1 more
@nateweisz
Copy link

nateweisz commented May 1, 2024

jda-utilities is still on jda 4, I don't think it's recommended at all

@Andre601
Copy link
Contributor

Andre601 commented May 1, 2024

This is not a JDA, but a JDA-Utilities issue.
If you want to use utils for v5 of JDA, use 2.0-SNAPSHOT of JDA-Chewtils by Chew.

More info: https://github.com/Chew/JDA-Chewtils/wiki/Compatibility-with-JDA-4-%26-5

@MinnDevelopment MinnDevelopment closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants