How do i know the correct build path of a plugin?

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

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

    football70500

    Hello, I would like to know how do i know the build path of a plugin because i am trying to edit some source code and i'm doing fine, but i can't export the file correctly because The plugin isn't on its correct build path. Can someone please tell me where i can find this information.
     
  2. Offline

    comp8nerd4u2

    What IDE are you using? (Eclipse and NetBeans are the most popular for development with Java) Try creating a new project and place each source in it's correct package. Also, make sure you are at least importing the craftbukkit.jar or the bukkit.jar. In eclipse, you'd do this by going to the project's properties and modifying the build path. In the build path screen, click the tab libraries, and then "Add External Jar". Navigate to where you have stored craftbukkit.jar or bukkit.jar and select it. Now export the project as a simple jar and place it in your server's plugins folder. Type "reload" into the server console or "/reload" while ingame. If any errors come up in the IDE then post exactly how you have your workspace setup. If any errors come up on the server console, paste your source code and server log.
     
  3. Offline

    football70500

    I do that, and then it tells me its not on its correct build path

    Btw i am using eclipse
     
  4. Offline

    comp8nerd4u2

    I'm going to take a guess that your workspace isn't configured properly. It should never give you that message, and I mean never lol I'm sorry but we can't help you unless you tell us the exact steps you took from creating the project to exporting the project. Is this a message that happens when you try to export it?
     
  5. Offline

    football70500

    It says JAR CREATION FAILED. See details for additional information. I look at details and it says:

    JAR creation failed. See details for additional information.
    src/org/kitteh/vanish [in VanishNoPacket] is not on its project's build path
    Unable to get package fragment root: VanishNoPacket/src/org/kitteh/vanish/VanishCommand.java
    src/org/kitteh/vanish [in VanishNoPacket] is not on its project's build path
    src/org/kitteh/vanish [in VanishNoPacket] is not on its project's build path
    Unable to get package fragment root: VanishNoPacket/src/org/kitteh/vanish/VanishManager.java
    src/org/kitteh/vanish [in VanishNoPacket] is not on its project's build path
    src/org/kitteh/vanish [in VanishNoPacket] is not on its project's build path
    Unable to get package fragment root: VanishNoPacket/src/org/kitteh/vanish/VanishPerms.java
    src/org/kitteh/vanish [in VanishNoPacket] is not on its project's build path

    I'm trying to edit the code for VanishNoPacket

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

    comp8nerd4u2

    Hmm I ***think*** I know what is wrong. Go into your build path and make sure there is a check mark next to src.
     
  7. Offline

    football70500

    JAR creation failed. See details for additional information.
    src/org/kitteh/vanish [in VanishNoPacket] is not on its project's build path
    Unable to get package fragment root: VanishNoPacket/src/org/kitteh/vanish/VanishManager.java
    src/org/kitteh/vanish [in VanishNoPacket] is not on its project's build path
    thats the error i get
    Can u provide screenshots please?
     
  8. Offline

    comp8nerd4u2

    Ok this is coming from a Ubuntu box but here it is:
    [​IMG]

    Go to your projects properties.

    [​IMG]

    Then go to your Java Build Path and make source you have ALL your project's source files in your build path. In your case I KNOW you are missing your project's source files from your build path. Please put all source folders on the build path. Yes, that is my own personal private WorldManager plugin xD Sadly, it'll never be released as there is already a ton of them out there. Lol. I really hope this helps :D Hopefully, if i'm not able to help you, then someone else who can will see this thread. Don't worry, I won't stop trying unless you tell me to stop :)
     
  9. Offline

    football70500


    I export it with warnings and i understand those but they don't affect my other plugin. Anyways, here is the error i get when i try to load it:



    2012-03-25 06:57:03 [SEVERE] Could not load 'plugins\VanishNoPacket.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: me.football70500.AntiGrief.AntiGrief
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:150)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.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>(ServerConfigurationManager.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.ClassNotFoundException: me.football70500.AntiGrief.AntiGrief
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139)
    ... 8 more

    Btw i edited the code of that.

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

    comp8nerd4u2

    The Bukkit plugin loader is unable to locate your AntiGrief class in package me.football70500.AntiGrief. Please edit your plugin.yml and make sure the "main" points to the proper "package.class". Also, don't put capital letters in your package names, so name it "me.football70500.antigrief" and make sure this package contains your AntiGrief class. The only way for you to get the error you've described is by having "main" point somewhere not actually containing the class. Trust me, this is the cause.
     
Thread Status:
Not open for further replies.

Share This Page