首页 > 解决方案 > 使用我自己的图书馆,找不到类

问题描述

我正在开发我的 Bukkit 插件,并且我有一个不错的库,我想在其中使用它。不幸的是,有人告诉我找不到该库的类。

org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: zone/luaq/lib/utils/command/LCommandExecutor

总而言之,我的库只是为了让我在处理 Bukkit API 时更轻松。我正在重新制作诸如记分板、命令等之类的东西。但是,当我尝试在我的插件上使用它时,它根本找不到类,我的 IDE (IntelliJ) 也会通知我找不到类,即使它在找到它们时编程(仅当我使用库本身而不是库 jar 文件时才会出现此错误)。

在代码中,这就是我所拥有的。

LCommandUtils.register(this, "broadcast", new Broadcast());
LCommandUtils.register(this, "heal", new Heal(), true);
LCommandUtils.register(this, "feed", new Feed(), true);
LCommandUtils.register(this, "fly", new Fly(), true);
LCommandUtils.register(this, "flyspeed", new FlySpeed(), true);

即使库插件在服务器上加载正常,它似乎也找不到该类。如果有人可以提供帮助,那就太好了。

提前致谢, Luaq

标签: javaclassnotfoundexceptionminecraft

解决方案


推荐阅读