Minecraft 插件:JDA 库与 Kotlin 冲突导致问题

问题描述 投票:0回答:1

我目前正在开发一个使用 JDA 库的 Minecraft 插件,唯一的问题是 JDA 实现了一个 Kotlin 库,导致与来自云端的另一个 Kotlin 插件出现问题,因为它们是不同的版本。

我得到的确切错误是这样的:

07:42:24 [WARNING] Exception encountered when loading plugin: SimpleCloud-Permissions
java.lang.LinkageError: loader constraint violation: when resolving interface method 'eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise.then(kotlin.jvm.functions.Function1)' the class loader net.md_5.bungee.api.plugin.PluginClassloader @5ce8d869 of the current class, eu/thesimplecloud/module/permission/PermissionPool, and the class loader net.md_5.bungee.api.plugin.PluginClassloader @5460cf3a for the method's defining class, eu/thesimplecloud/clientserverapi/lib/promise/ICommunicationPromise, have different Class objects for the type kotlin/jvm/functions/Function1 used in the signature (eu.thesimplecloud.module.permission.PermissionPool is in unnamed module of loader net.md_5.bungee.api.plugin.PluginClassloader @5ce8d869, parent loader 'app'; eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise is in unnamed module of loader net.md_5.bungee.api.plugin.PluginClassloader @5460cf3a, parent loader 'app')
    at eu.thesimplecloud.module.permission.PermissionPool.<init>(PermissionPool.kt:51)
    at eu.thesimplecloud.module.permission.service.bungee.BungeePluginMain.onEnable(BungeePluginMain.kt:32)
    at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:266)
    at net.md_5.bungee.BungeeCord.start(BungeeCord.java:298)
    at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
    at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
07:42:24 [INFO] 

有没有办法绕过这个或者不包含 Kotlin 的版本?

java kotlin maven minecraft discord-jda
1个回答
0
投票

使用linux shell脚本而不是基于Java和Java,你将拥有幸福的生活

© www.soinside.com 2019 - 2024. All rights reserved.