Solved Class files on classpath not found or not accessible

Discussion in 'Plugin Development' started by lilian58660, Jul 28, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    lilian58660

    hey guys, today I tried to code something and dispatch all listeners and command correctly ( I usually use one class and write everything in.
    This is my main class:
    Code:
    package lilian.xteam;
    
    import lilian.xteam.commands.FreezeCommand;
    import lilian.xteam.listener.FreezeListener;
    import lilian.xteam.listener.HeadListener;
    
    import org.bukkit.Bukkit;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin{
          
        private static Plugin plugin;
      
        public void onEnable() {
            plugin = this;
            registerEvents(this, new HeadListener(), new FreezeListener());
            getCommand("freeze").setExecutor(new FreezeCommand());
            getConfig().options().copyDefaults(true);
            saveConfig();
        }
      
        public void onDisable() {
          
        }
      
      
        public static void registerEvents(org.bukkit.plugin.Plugin plugin, Listener... listeners) {
            for (Listener listener : listeners) {
                Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
            }
        }
      
        public static Plugin getPlugin() {
            return plugin;
        }
      
      
      
    }
    Nothing special in others class.
    But when I try to compile my plugin I get an error:
    JAR creation failed. See details for additional information.
    Class files on classpath not found or not accessible for: 'xTeam/src/lilian/xteam/commands/FreezeCommand.java'
    Class files on classpath not found or not accessible for: 'xTeam/src/lilian/xteam/listener/HeadListener.java'
    Class files on classpath not found or not accessible for: 'xTeam/src/lilian/xteam/listener/FreezeListener.java'
    Class files on classpath not found or not accessible for: 'xTeam/src/lilian/xteam/utils/Utils.java'
    Hope you can help me to solve my problem

    PS: I searched into google, nothing helped me out
    PS2: Ik I have bad english ^^
     
  2. Offline

    mine-care

    @lilian58660 it may be an eclipse bug, try moving your classes/packages to a new project.
     
  3. Offline

    lilian58660

    Still not working...
     
  4. Offline

    guitargun

    What are those statics......... And pls read the tutorial again you don't use or.bukkit.plugin but you won plugins main
     
  5. Offline

    lilian58660

    Okay, it does not help me...
     
  6. Offline

    guitargun

    You are using Plugin.. That is a reference to the main of the bukkit api which you don't use since your main is extending javaplugin. Chance this to your main class and then it should work better
    better. I am on my phone now so I can't give you a better example
     
  7. Offline

    blablubbabc

    @lilian58660
    I assume you use Eclipse?
    A quick google search brought up those:
    These suggest that the problem might be something regarding the build path of your project, which might get fixed by 'cleaning and rebuilding the project' (The option for that ('Clean...') is the the 'Project' tab at the top of Eclipse).

    There are some other search results as well, which suggest that the project might be not correctly setup / created / imported.
     
  8. Offline

    lilian58660

    Okay fixed.
    I just added JRE library and my spigot in buildpath --> order and export ^^
    Thanks for the answers anyway
     
Thread Status:
Not open for further replies.

Share This Page