Solved Classes error, Please Help

Discussion in 'Plugin Development' started by Leo38638, Dec 31, 2014.

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

    Leo38638

    Now my server is with Online true... My Server propoerties where true but my code was in false .-.

    Well Im new in this thing but every time I make my plugin.yml it dosnt work look I will paste my code and some photos so you can help me

    Code:
    [14:20:45] [Server thread/INFO]: Starting minecraft server version 1.7.2
    [14:20:45] [Server thread/INFO]: Loading properties
    [14:20:45] [Server thread/INFO]: Default game type: SURVIVAL
    [14:20:45] [Server thread/INFO]: Generating keypair
    [14:20:45] [Server thread/INFO]: Starting Minecraft server on *:25568
    [14:20:45] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.2-R0.2-b2974jnks (MC: 1.7.2) (Implementing API version 1.7.2-R0.2)
    [14:20:45] [Server thread/ERROR]: Could not load 'plugins\KillDrops.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: com.cavariux.bukkit.Killerdrops.java
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:308) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:231) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.java:255) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.<init>(CraftServer.java:233) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.PlayerList.<init>(PlayerList.java:63) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.DedicatedPlayerList.<init>(SourceFile:14) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:126) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:424) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    Caused by: java.lang.ClassNotFoundException: com.cavariux.bukkit.Killerdrops.java
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_65]
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_65]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_65]
        at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_65]
        at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_65]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_65]
        at java.lang.Class.forName0(Native Method) ~[?:1.7.0_65]
        at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_65]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        ... 9 more
    [14:20:46] [Server thread/INFO]: Preparing level "world"
    [14:20:46] [Server thread/INFO]: Preparing start region for level 0 (Seed: 2610551802641757988)
    [14:20:46] [Thread-7/WARN]: Could not get information about this CraftBukkit version; perhaps you are running a custom one?: IOException
    [14:20:46] [Server thread/INFO]: Preparing start region for level 1 (Seed: 2610551802641757988)
    [14:20:46] [Thread-7/WARN]: Could not get latest artifact information: IOException
    [14:20:47] [Server thread/INFO]: Preparing start region for level 2 (Seed: 2610551802641757988)
    [14:20:47] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [14:20:47] [Server thread/INFO]: Done (1.268s)! For help, type "help" or "?"
    [14:20:51] [Server thread/INFO]: CONSOLE: Stopping the server..[m
    [14:20:51] [Server thread/INFO]: Stopping server
    [14:20:51] [Server thread/INFO]: Saving players
    [14:20:51] [Server thread/INFO]: Saving worlds
    [14:20:51] [Server thread/INFO]: Saving chunks for level 'world'/Overworld
    [14:20:51] [Server thread/INFO]: Saving chunks for level 'world_nether'/Nether
    [14:20:51] [Server thread/INFO]: Saving chunks for level 'world_the_end'/The End
    [14:20:52] [Thread-4/INFO]: Stopping server
    [14:20:52] [Thread-4/INFO]: Saving players
    [14:20:52] [Thread-4/INFO]: Saving worlds
    
    My code is simple and only uses the enables:

    Code:
    package com.cavariux.bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.entity.PlayerDeathEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.java.JavaPlugin;
    public class Killerdrops extends JavaPlugin {
      
        @Override
        public void onEnable(){
            getLogger().info("KillDrops v1.0 has been Enabled");
        }
      
        @Override
        public void onDisable(){
            getLogger().info("KillDrops v1.0 has been Enabled");
        }
      
    }
    My Plugin.YML is like this:

    name: Killerdrops
    main: com.cavariux.bukkit.Killerdrops
    version: 1.0
    description: Cada vez que matas a alguien te daran dos gemas

    And my class and my plugin.yml is organized like this:

    [​IMG]

    Please Help cause I dont understand
     
  2. Offline

    AngryCupcake274

    @Leo38638 what version of Bukkit did you implement into your plugin?
     
  3. Offline

    Leo38638

    1.7.2-r0.2
     
  4. @Leo38638 Very simple, you added .java on your main path in plugin.yml.
     
  5. Offline

    Leo38638

    I thought it worked but nope steal the error :(

    I try by changing mayus putting java
     
  6. @Leo38638 Please re-post error and plugin.yml
     
  7. Offline

    Leo38638


    NEW ERRORS:

    Code:
    [14:45:31] [Server thread/INFO]: Starting minecraft server version 1.7.2
    [14:45:31] [Server thread/INFO]: Loading properties
    [14:45:31] [Server thread/INFO]: Default game type: SURVIVAL
    [14:45:31] [Server thread/INFO]: Generating keypair
    [14:45:31] [Server thread/INFO]: Starting Minecraft server on *:25568
    [14:45:31] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.2-R0.2-b2974jnks (MC: 1.7.2) (Implementing API version 1.7.2-R0.2)
    [14:45:31] [Server thread/ERROR]: Could not load 'plugins\KillDrops.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: com.cavariux.bukkit.KillerDrops
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:308) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:231) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.java:255) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.<init>(CraftServer.java:233) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.PlayerList.<init>(PlayerList.java:63) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.DedicatedPlayerList.<init>(SourceFile:14) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:126) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:424) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    Caused by: java.lang.ClassNotFoundException: com.cavariux.bukkit.KillerDrops
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_65]
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_65]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_65]
        at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_65]
        at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_65]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_65]
        at java.lang.Class.forName0(Native Method) ~[?:1.7.0_65]
        at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_65]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173) ~[CraftBukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
        ... 9 more
    [14:45:31] [Server thread/INFO]: Preparing level "world"
    [14:45:31] [Server thread/INFO]: Preparing start region for level 0 (Seed: 2610551802641757988)
    [14:45:31] [Thread-7/WARN]: Could not get information about this CraftBukkit version; perhaps you are running a custom one?: IOException
    [14:45:32] [Thread-7/WARN]: Could not get latest artifact information: IOException
    [14:45:32] [Server thread/INFO]: Preparing start region for level 1 (Seed: 2610551802641757988)
    [14:45:32] [Server thread/INFO]: Preparing start region for level 2 (Seed: 2610551802641757988)
    [14:45:32] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [14:45:32] [Server thread/INFO]: Done (1.283s)! For help, type "help" or "?"
    [14:45:51] [Server thread/INFO]: CONSOLE: Stopping the server..[m
    [14:45:51] [Server thread/INFO]: Stopping server
    [14:45:51] [Server thread/INFO]: Saving players
    [14:45:51] [Server thread/INFO]: Saving worlds
    [14:45:51] [Server thread/INFO]: Saving chunks for level 'world'/Overworld
    [14:45:51] [Server thread/INFO]: Saving chunks for level 'world_nether'/Nether
    [14:45:51] [Server thread/INFO]: Saving chunks for level 'world_the_end'/The End
    [14:45:52] [Thread-4/INFO]: Stopping server
    [14:45:52] [Thread-4/INFO]: Saving players
    [14:45:52] [Thread-4/INFO]: Saving worlds
    [14:45:52] [Thread-4/INFO]: Saving chunks for level 'world'/Overworld
    
    and my yml I added a new folder to the package so its like this:

    name: Killerdrops
    main: com.cavariux.bukkit.killerdrops.KillerDrops
    version: 1.0
    description: Cada vez que matas a alguien te daran dos gemas

    but I changed the code:

    Code:
    package com.cavariux.bukkit.killerdrops;
    
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.entity.PlayerDeathEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Killerdrops extends JavaPlugin {
       
        @Override
        public void onEnable(){
            getLogger().info("KillDrops v1.0 has been Enabled");
        }
       
        @Override
        public void onDisable(){
            getLogger().info("KillDrops v1.0 has been Enabled");
        }
       
    }
    
     
  8. Offline

    teej107

    @Leo38638 The main: in your plugin.yml must be the fully qualified name of your JavaPlugin extended class. It is case sensitive!
     
  9. Offline

    Leo38638

    Yep tright twice
     
  10. Offline

    mrCookieSlime

    What @teej107 is saying is that you need to specify the exact name of your main class in your plugin.yml It is case-sensitive.
    In your plugin.yml you specified KillerDrops as the main class, however your class is called Killerdrops.
    Please make them both be equal otherwise your Plugin won't work.
     
    teej107 likes this.
  11. Offline

    teej107

  12. Offline

    Leo38638

    Thnxs guys it work :3

    The ones who ask me how I get it to work I try changing to much times the upperletters and changing
     
    Last edited by a moderator: Dec 31, 2014
Thread Status:
Not open for further replies.

Share This Page