Solved I need help!

Discussion in 'Plugin Development' started by technerder, Aug 22, 2016.

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

    technerder

    i finally finished my plugin however at the end of compilation:

    a- it gives me an error: this was exported with errors
    b- when i put it in my plugins folder to test it, it says:
    Code:
    [12:06:55 ERROR]: Could not load 'plugins\EnderChest.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `technerder.shadowtech.echest'
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:42) ~[Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:127) ~[Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:328) ~[Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins(CraftServer.java:364) [Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.<init>(CraftServer.java:326) [Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.PlayerList.<init>(PlayerList.java:68) [Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.DedicatedPlayerList.<init>(SourceFile:14) [Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.DedicatedServer.init(DedicatedServer.java:133) [Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:436) [Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
    Caused by: java.lang.ClassNotFoundException: technerder.shadowtech.echest
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_101]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:77) ~[Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:62) ~[Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_101]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_101]
            at java.lang.Class.forName0(Native Method) ~[?:1.8.0_101]
            at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_101]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:40) ~[Server.jar:git-Bukkit-1.7.9-R0.2-20-g0b2ed13-b3108jnks]
            ... 10 more
    can someone please tell me why this isn't working!?

    here is the whole thing
    :[​IMG]
     
  2. Offline

    SantaClawz69

    You probably didn't input the main class in your plugin.yml correctly, or at all. Can I see your plugin.yml?

    Also exporting with errors is never a good thing, if you know it's not functional you should always go ahead and comment them out instead of exporting with errors. It could lead to other problems.
     
  3. Offline

    technerder

    Code:
    name: EChest
    main: technerder.shadowtech.echest
    version: 1.0
    commands:
       echest:
          description: Opens The Players EnderChest!
          usage: /echest

    @SantaClawz69

    should i change the "technerder.shadowtech.echest" to main.class or main? (i have never had to do this before)
     
    Last edited: Aug 22, 2016
  4. Offline

    Zombie_Striker

    That means that there is an error in one of your classes. If you're using an IDE (like eclipse), then it should underline the lines that have an error on them. Fix the errors, and this should be fixed.

    It seems you are missing your main class from this path. (unless echest is your main class, in which-case it should start with an uppercase letter.) Make sure the path you provided is exactly the same as your package and classname.
     
  5. Offline

    technerder

    there is one error at the bottom of the page, i added the image of my file path
     

    Attached Files:

  6. Offline

    SantaClawz69

    EDIT: Forget everything I said, the reason why it's not loading is because you're missing a bracket in your main class. Add 1 more bracket at the end and re-export it and you should be good.

    Also in the plugin.yml make it technerder.shadowtech.echest.EChest

    Instead of just the package name @technerder
     
    Last edited: Aug 22, 2016
  7. Offline

    technerder

    @SantaClawz69 so i change my package name to technerder.shadowtech.echest.mainclass ?
     
  8. Offline

    SantaClawz69

    Yes, I made an edit of all the things you should do. After that re-export and you should be fine.
     
  9. Offline

    technerder

    @SantaClawz69 however if i do add an extra bracket it will underline all of
    "public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {


    EDIT: Never mind its fixed now

    @SantaClawz69 thank you for your help!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Aug 22, 2016
  10. Offline

    SantaClawz69

    No problem, please set this thread to solved so others don't get confused :)
     
Thread Status:
Not open for further replies.

Share This Page