Solved New plugin writer needs help :)

Discussion in 'Plugin Help/Development/Requests' started by Rostik002, May 23, 2015.

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

    Rostik002

    hello, I have decided to get into making plugins.
    I have started following the tutorial at


    but when I launch the server with the plugin I get the following error in the console:
    [22:30:32 ERROR]: Could not load 'plugins\Hello.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.bukkit.Rost
    ik002.FirstPlugin'
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:66) ~[spigot_server.jar:git-Spigot-870264a-0a645a2]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:131) ~[spigot_server.jar:git-Spigot-870264a-0a645a2]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:329) ~[spigot_server.jar:git-Spigot-870264a-0a645a2]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:251) [spigot_server.jar:git-Spigot-870264a-0a645a2]
    at org.bukkit.craftbukkit.v1_8_R2.CraftServer.loadPlugins(CraftServer.ja
    va:291) [spigot_server.jar:git-Spigot-870264a-0a645a2]
    at net.minecraft.server.v1_8_R2.DedicatedServer.init(DedicatedServer.jav
    a:199) [spigot_server.jar:git-Spigot-870264a-0a645a2]
    at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java
    :522) [spigot_server.jar:git-Spigot-870264a-0a645a2]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
    Caused by: java.lang.ClassNotFoundException: me.bukkit.Rostik002.FirstPlugin
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_45]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:101) ~[spigot_server.jar:git-Spigot-870264a-0a645a2]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:86) ~[spigot_server.jar:git-Spigot-870264a-0a645a2]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_45]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_45]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_45]
    at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_45]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:64) ~[spigot_server.jar:git-Spigot-870264a-0a645a2]
    ... 7 more

    Any help would be nice, thank you :)
     
  2. Online

    timtower Moderator Moderator

    Moved to Bukkit alternatives.
    First line of your main class and the class name?
     
  3. Offline

    Rostik002

    first line: package me.Rostik002;
    Class name: FirstPlugin.java
     
  4. Offline

    robertforyou

    What's in your plugin.yml?
     
  5. Offline

    Rostik002

    Code:
    name: FirstPlugin
    main: me.bukkit.Rostik002.FirstPlugin
    version: 1.0
    commands:
       hello:
          description: Blank description.
          usage: /hello
     
    Last edited by a moderator: May 24, 2015
  6. Offline

    CoolGamerXD

    @Rostik002 The problem is in your plugin.yml. Make sure you have correctly specified yor main class.
     
    Last edited: May 24, 2015
  7. Offline

    Rostik002

    Thank you, turns out i had to use "me.Rostik002.FirstPlugin" and not "me.bukkit.Rostik002.FirstPlugin" in my plugin.yml
     
  8. Offline

    CoolGamerXD

    @Rostik002 Mark this thread as solved. And yes, You have to use your package at starting and at the end your main class name.
     
Thread Status:
Not open for further replies.

Share This Page