由java.lang.classnotfoundexception引起的bot jda不工作

p4rjhz4m  于 2021-07-08  发布在  Java
关注(0)|答案(0)|浏览(299)

我正在尝试使用java discord api构建discord bot,但在运行以下代码段时:

  1. public static void main(String[] args) throws LoginException {
  2. JDABuilder builder = JDABuilder.createDefault(token);
  3. builder.setActivity(Activity.watching("boop"));
  4. builder.build();
  5. }

它引发以下异常:

  1. Exception in thread "main" java.lang.NoClassDefFoundError: gnu/trove/map/TLongObjectMap
  2. at net.dv8tion.jda@4.2.0_216/net.dv8tion.jda.api.entities.Activity.watching(Activity.java:204)
  3. at rambot/rambot.discord.MainApp.main(MainApp.java:14)Caused by: java.lang.ClassNotFoundException: gnu.trove.map.TLongObjectMap
  4. at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
  5. at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
  6. at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
  7. ... 2 more

为什么要扔这个,我该怎么修?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题