Spigot Minecraft插件编码NoClassDefFound错误mysql

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

当我启动服务器时出现此错误:我正在使用IntelliJ Idea,并将MySQL jar添加到src和项目模块中。

Error pastebin

这是我的代码

package com.okaam.jaajhome;

import org.bukkit.plugin.java.JavaPlugin;
import pro.husk.mysql.MySQL;

import java.sql.Connection;
import java.sql.SQLException;

public class JaaJHome extends JavaPlugin {
 static JaaJHome instance = null;

    MySQL MySQL = new MySQL("address", "port", "schema", "user", "password", "");
    static Connection c = null;

 @Override
    public void onEnable() {
     System.out.println("Plugin JaaJHome active");
     getCommand("sethome").setExecutor(new SetHomeExecutor());
     getCommand("home").setExecutor(new HomeExecutor());
     try {
         c = MySQL.getConnection();
     } catch (SQLException e) {
         e.printStackTrace();
     }
     instance = this;
 }

    public static JaaJHome getInstance() {
        return instance;
    }
}

java mysql minecraft
1个回答
0
投票

看来您缺少某些依赖项,请确保您将它们作为非插件存在于plugins文件夹中,或确保其已加载在类路径中。

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