gpt4 book ai didi

java - Minecraft 插件 NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-01 16:41:57 25 4
gpt4 key购买 nike

我正在尝试为 Minecraft 创建插件,以便它可以与 Discord 进行通信。我尝试使用 JDA 库。但是当我引用它时,它会抛出这个错误:

[07:13:17] [Server thread/ERROR]: Error occurred while enabling MinecraftDiscordBot v1.0 (Is it up to date?)
java.lang.NoClassDefFoundError: net/dv8tion/jda/api/JDABuilder
at notURL.RedstoneExpert.MinecraftDiscordBot.Main.discordLogin(Main.java:24) ~[?:?]
at notURL.RedstoneExpert.MinecraftDiscordBot.Main.onEnable(Main.java:14) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:352) [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:417) [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugin(CraftServer.java:461) [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugins(CraftServer.java:375) [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at net.minecraft.server.v1_14_R1.MinecraftServer.a(MinecraftServer.java:449) [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:266) [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:775) [spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
Caused by: java.lang.ClassNotFoundException: net.dv8tion.jda.api.JDABuilder
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_231]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:135) ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot-1.14.4.jar:git-Spigot-cbd1a1b-009d8af]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_231]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_231]
... 11 more

你能帮我吗?

最佳答案

我解决了,JDA库没有用插件导出,所以我使用了maven assembly插件。最好使用intellij idea而不是eclipse,因为您可以轻松选择要导出的依赖项。

关于java - Minecraft 插件 NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61847485/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com