I'm very new to plugin development, and every time I try to export my plugin, I get this message: Class files on classpath not found or not accessible for [plugin .java file]. Please help, I'm not sure what to include here, so please ask me if you need to know anything to solve this.
Bump, still not solved; Could not load 'plugins/Another.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: me.Anrza.Another.Main at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugins(CraftServer.java:241) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.reload(CraftServer.java:613) at org.bukkit.Bukkit.reload(Bukkit.java:277) at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:192) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.dispatchCommand(CraftServer.java:528) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.dispatchServerCommand(CraftServer.java:515) at net.minecraft.server.v1_6_R3.DedicatedServer.as(DedicatedServer.java:263) at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:228) at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:488) at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:421) at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583) Caused by: java.lang.ClassNotFoundException: me.Anrza.Another.Main at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173) ... 14 more
Hmmm.... It seems me.Anrza.Another.Main is not found, you specified that in the plugin.yml to find what it actually is... Step 1. Open another.jar (DON'T RUN IT) in a program like WinRar Step 2. Click me, Anrza, and Another, then see if Main.class is a class, Step 3. If it is, go back one check if Another is spelled correctly Step 4. Go back again check if Anrza is spelled correctly Step 5. Then check if me is spelled correctly. Step 6. Check if Main extends JavaPlugin in the very beggining Note: Even if it is spelled correctly, check if the caps match me.Anrza.Another.Main (those are folders and main is main.class) Hope this helped you!
So it's unable to find your Main class. Check that the main field in plugin.yml matches the package in your class (could well be an issue of case-sensitivity) and check that your main extends JavaPlugin
This is my plugin.yml: name: Another main: me.Anrza.Another.Main version: 1.0 description: > Another test commands: Another: description: Sends you a message And this is my plugin, as it appears in eclipse: Another src me.Anrza.Another Main.java plugin.yml Failed on step 2, because there is no "me" folder in it. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Upload your plugin, then there is definetely an error... It should look like this in your plugin.jar: EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Anrza errr yeah... then something went wrong. Upload Another.jar to mediafire.com or dropbox.com Does it look like this?:
Anrza erm... There is absalutely no code in their whatsoever, just the manifest file and the classpath project and plugin.yml... Try exporting again, right click on the project, click java, jar file, name it Another.jar in wherever, then try again.
I fail on "right click on the project". Where am I suppose to click this? In the project explorer on the left? Gives me the "you're clicking outside the box"-error sound.
Anrza Errr, i don't know then i'll just do it for you if its this much trouble, just paste the main.class/main.java code in the code box aka [ CODE ] without the spaces, or click the "code" button and copy and paste everything into it.
Oh, great! I needed someone to code the exact plugins I wanted for my server, which I have five pages of mechanics on (sarcasm). Yea, thing is, I wanna learn to code myself. Thanks for offering, and thanks for trying to help me! So, anyone else got any idea why I'm failing?
errr... I was just asking that as that seems like a project error, not you failing to right click on the project and press "Export" lol, whatever though try it again RIGHT CLICK ON THE MAIN JAVA PROJECT, CLICK EXPORT, AND THEN CLICK JAR FILE, THEN NAME IT ANOTHER.JAR IF YOU FAIL TO DO THAT YOU WILL NEVER BE A CODER. lol Anyway, the reason your failing is because there is no code, just the plugin.yml and metadeta. I'm starting to assume this is a troll post, you can't somehow get everything but the code unless you have no code.
Oh, I guess I misunderstood you. Sorry. Laughed at "if you fail to do that...", yea, I misunderstood you pretty badly. Code: package me.Anrza.Another; import java.util.logging.Logger; import net.minecraft.server.v1_5_R3.PlayerInventory; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; public class Another extends JavaPlugin{ public final Logger logger = Logger.getLogger("Minecraft"); public static Another plugin; @Override public void onDisable() { PluginDescriptionFile pdfFile = this.getDescription(); this.logger.info(pdfFile.getName() + "Has been Disabled!"); } @Override public void onEnable() { PluginDescriptionFile pdfFile = this.getDescription(); this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + "Has been Enabled!"); } public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ Player player = (Player) sender; if(commandLabel.equalsIgnoreCase("Another")); player.sendMessage("Another was sent ");//Your message return false; } } I followed this tutorial for the code.
@Anzra That tutorial is way outdated, 1.5 but the code should still work as I followed a tut made a year ago and the code still worked xD The code is fine, its just the damned eclipse export system... Speaking of damned eclipse, it won't open...
Well, actually eclipse did open... just a long delay because of a coin-miner macromedia PUP lol... Now I have 43 eclipse windows... Wow. and rsod you sir are correct, didn't notice that!
I've failed with a couple of other tutorials too. I'm getting the same error almost every time, and I guess it's some setting of mine that makes it pretend like the class isn't there.
Anrza Also I can tell even without the code, i looked at the .classpath and .project, your using CB 1.6.4 for MC 1.6.4 you know? oh and your trying to use craftbukkit 1.6.4, not bukkit 1.6.4 #BIGMISTAKEMISTER Jaaakee224 I thought TheBCBroz was a good channel... JK anyway, thats not TheBCBroz EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Huh? So if I fix this, will my problems be solved? And if so, how do I fix them? I have one class. Very sure it's called Main, Main.java. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Anrza[quote uid=90916372 name="Anrza" post=2485580]Huh? So if I fix this, will my problems be solved? And if so, how do I fix them?[/quote] Fixed the plugin: <Edit by Moderator: Redacted mediafire url> Enables: And it works even on 1.7.2 builds!: Fixed code: Code:java package me.Anrza.Another; import java.util.logging.Logger; import org.bukkit.*;import org.bukkit.entity.*;import org.bukkit.ChatColor;import org.bukkit.Material;import org.bukkit.command.Command;import org.bukkit.command.CommandSender;import org.bukkit.entity.Player;import org.bukkit.inventory.ItemStack;import org.bukkit.plugin.PluginDescriptionFile;import org.bukkit.plugin.java.JavaPlugin; @SuppressWarnings("unused")public class Main extends JavaPlugin{ public final Logger logger = Logger.getLogger("Minecraft"); public static Main plugin; @Override public void onDisable() { PluginDescriptionFile pdfFile = this.getDescription(); this.logger.info(pdfFile.getName() + "Has been Disabled!"); } @Override public void onEnable() { PluginDescriptionFile pdfFile = this.getDescription(); this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + "Has been Enabled!"); } public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ Player player = (Player) sender; if(commandLabel.equalsIgnoreCase("Another")); player.sendMessage("Another was sent ");//Your message return false; }} SkillSam[quote uid=90817361 name="SkillSam" post=2485599]Anrza I'm not very sure anymore, the code you posted before had the class name of Another.java, not Main.java...[/quote] Thats true, I had to fix that it is sussposed to be Main extends JavaPlugin not Another extends JavaPlugin and not Public Static Another Plugin, you use Public Static Main Plugin ITS THE NAME OF THE CLASS FILE NOT THE PLUGIN EDIT by Moderator: merged posts, please use the edit button instead of double posting.
[quote uid=90952759 name="cdriza" post=2485596]Anrza Fixed the plugin: <Edit by Moderator: Redacted mediafire url> [/quote] Thank you! I will look in the .jar and see what I can learn from it! [quote uid=90817361 name="SkillSam" post=2485599]Anrza I'm not very sure anymore, the code you posted before had the class name of Another.java, not Main.java...[/quote] Hmm, dunno, maybe it's solved now. Thanks for bothering.
Anrza You can't learn anything from the .jar file, lel Use the code that I posted to learn my friend :3 Anrza USE THE CODE!!!! EDIT by Moderator: merged posts, please use the edit button instead of double posting.