Plugin can't find ClassFile specified in plugin.yml

Discussion in 'Plugin Development' started by Justin Quach, Mar 24, 2012.

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

    Justin Quach

    Hey Bukkit,
    Alright so I just got into development, and this is my first plugin.
    It's a plugin to greet new joiners, and I have the folders like so:
    src/fj/FirstJoin.class

    This is my Plugin.yml
    name: FirstJoin
    main: fj.FirstJoin
    version: 1.0
    author: Qwahchees

    What's going on?
    I get this:
    22:22:44 [SEVERE] Could not load 'plugins\FirstJoin.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassCastException: class f
    .FirstJoin
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.
    ava:150)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager
    java:305)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManage
    .java:230)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:207)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:183)
    at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigu
    ationManager.java:53)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:156)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    Caused by: java.lang.ClassCastException: class fj.FirstJoin
    at java.lang.Class.asSubclass(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.
    ava:140)
    ... 8 more

    Nevermind, /void this I found the problem.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  2. Offline

    Musaddict

    Just a friendly reminder to rename your topics with "[Solved]" once a solution is found, as a courtesy.
     
  3. Offline

    Ismaw34

    Can you share the solution. Im having a similar issue :S
    Thanks, Ismaw34
     
  4. Offline

    bleachisback

    I bet you need to extend JavaPlugin
     
  5. Offline

    Njol

    You have to put the full path in 'main:' in your plugin.yml, e.g. 'main: my.package.MyPlugin' where MyPlugin is the main class whose package definition is 'package my.package;'
     
  6. Offline

    Ismaw34

    Hello, i have extended the class:
    Code:
    public class Test extends JavaPlugin implements Listener {

    And the main package its fine:
    Code:
    main: test.plugin.Test

    Assuming is src/test/plugin/Test.class

    Thanks, Ismaw34

    Added the bukkit.jar, all the net and org things.
    And its working again... Thanks, Ismaw34
     
Thread Status:
Not open for further replies.

Share This Page