Solved java.lang.IncompatibleClassChangeError

Discussion in 'Plugin Development' started by nathanthesnooper, Jan 20, 2018.

Thread Status:
Not open for further replies.
  1. EDIT: Renaming the package fixed the error, weird

    Sorry to just plop code on a forum and beg for answers, but I have been unable to fix this.

    The same problem occurs with final variables/functions

    for (Rank r : RankManager.getRanks()) { // Error
        System.out.println("Initializing team " + RankManager.removeColors(RankManager.rankToString(r)));
        Team team = board.getTeam(r.toString().toLowerCase());
        if(team == null) {
            team = board.registerNewTeam(r.toString().toLowerCase());
        team.setOption(Option.COLLISION_RULE, OptionStatus.NEVER);
        team.setOption(Option.NAME_TAG_VISIBILITY, OptionStatus.ALWAYS);
        rankTeams.put(r, team);
    private static ArrayList<Rank> ranks = new ArrayList<Rank>();
    private static Rank[] ranksArray = null;
    public static Rank[] getRanks () {
        if(ranksArray != null) return ranksArray;
        Rank[] returns = new Rank[ranks.size()];
        for (int i = 0; i < ranks.size(); i++) {
            returns[i] = ranks.get(i);
        ranksArray = returns.clone();
        return returns;
    interface Rank {
       public String getPrefix();
       public ChatColor getColor();
       public int getPermissionLevel();
       public String getString();
    ERROR Error occurred while enabling Murderer v1.0 (Is it up to date?)
    java.lang.IncompatibleClassChangeError: Implementing class
    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_152]
    at java.lang.ClassLoader.defineClass( ~[?:1.8.0_152]
    at ~[?:1.8.0_152]
    at ~[spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at ~[spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at ~[spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at ~[spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at java.lang.ClassLoader.loadClass( ~[?:1.8.0_152]
    at java.lang.ClassLoader.loadClass( ~[?:1.8.0_152]
    at me.nathanthesnooper.Murderer.onEnable( ~[?:?]
    at ~[spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin( [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin( [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins( [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at net.minecraft.server.v1_12_R1.MinecraftServer.t( [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at net.minecraft.server.v1_12_R1.MinecraftServer.l( [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at net.minecraft.server.v1_12_R1.MinecraftServer.a( [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at net.minecraft.server.v1_12_R1.DedicatedServer.init( [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    at [spigot-1.12.2.jar:git-Spigot-9b8bba4-bdcc7c7]
    Last edited: Jan 20, 2018
  2. Offline

    Machine Maker

    Which line is line 178 in your class with you onEnable() method? Is it the line you marked with //Error?
  3. Yes
  4. Offline

    Machine Maker

    So I looked around for info on IncompatibleClassChangeError and found some stuff talking about how that error has something to do with static. Is there any way to make the getRanks() method in your RankManager class not static?
  5. new RankManager() throws the same error
  6. Offline

    Machine Maker

    hmm. I don't have any experience with this error, so I'm probably not the person to answer this.
  7. I changed it back to static and renamed the package, fixed
  8. Offline

    Machine Maker

    Huh. ok. Idk why that happened then. Be sure to mark the thread as solved if your issue is resolved.
Thread Status:
Not open for further replies.

Share This Page