Strange error

Discussion in 'Plugin Development' started by CraftCreeper6, Apr 22, 2014.

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

    CraftCreeper6

    Hello! So basically I have a plugin that I am creating and I don't know why I get this error:
    JAR creation failed. See details for additional information.
    Class files on classpath not found or not accessible for: 'Minigame (RickyBGamez and CraftCreeper6)/src/me/CraftCreeper6/utilites/Commands.java'

    Although my plugin.yml leads to that class..?
    plugin.yml:
    name: Minigame (RickyBGamez and CraftCreeper6)
    author: CraftCreeper6
    main: me.CraftCreeper6.utilites.Commands
    version: 1.0
    description: TEST

    commands:
    minigame :
    description: TEST
    set leavespawn:
    description: TEST
    leave:
    description: TEST

    Code:

    Code:java
    1. package me.CraftCreeper6.utilites;
    2.  
    3. import org.bukkit.ChatColor;
    4. import org.bukkit.Location;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.plugin.java.JavaPlugin;
    9.  
    10. public class Commands extends JavaPlugin{
    11.  
    12. private void teleportInWorld(Player p, double x, double y, double z) {
    13.  
    14. p.teleport(new Location(p.getWorld(), x, y, z));
    15.  
    16. }
    17.  
    18. private String pn = ChatColor.BLUE + "[" + ChatColor.GREEN + ChatColor.BOLD
    19. + "Mini" + ChatColor.RED + ChatColor.BOLD + " Game"
    20. + ChatColor.BLUE + "] " + ChatColor.LIGHT_PURPLE;
    21.  
    22. public void onEnable() {
    23.  
    24. getServer().getPluginManager().registerEvents(new InvGUI(), this);
    25.  
    26. System.out.print("MINIGAME ENALBED!");
    27. }
    28.  
    29. public void onDisable() {
    30. System.out.print("MINIGAME DISABLED!");
    31. }
    32.  
    33. public boolean onCommand(CommandSender sender, Command cmd,
    34. String commandLabel, String[] args) {
    35. Player p = (Player) sender;
    36.  
    37. if (commandLabel.equalsIgnoreCase("minigame")) {
    38.  
    39. if (args[0].equalsIgnoreCase("set") && args[1].equalsIgnoreCase("leavespawn")){
    40.  
    41. getConfig().set("Minigame.leavespawn.x", p.getLocation().getBlockX());
    42. getConfig().set("Minigame.leavespawn.y", p.getLocation().getBlockY());
    43. getConfig().set("Minigame.leavespawn.z", p.getLocation().getBlockZ());
    44. getConfig().set("Minigame.leavespawn.world", p.getWorld());
    45.  
    46. p.sendMessage(pn + "Succesfully set the leave spawn to x: " + p.getLocation().getBlockX() + " y: " + p.getLocation().getBlockY() + " z: " + p.getLocation().getBlockZ());
    47.  
    48. } else if(args[0].equalsIgnoreCase("leave"));
    49.  
    50. double x = (double) getConfig().get("Minigame.leavespawn.x");
    51. double y = (double) getConfig().get("Minigame.leavespawn.y");
    52. double z = (double) getConfig().get("Minigame.leavespawn.z");
    53.  
    54. teleportInWorld(p, x, y, z);
    55.  
    56. }
    57. return true;
    58. }
    59. }
    60.  

    Any help appreciated :D
     
  2. When you compile your code, what check boxes do you have ticked?
    Heres how I do it:
    Jar File (Not Runnable Jar File)
    Next button
    Tick 'Export generated class files and resources'
    Tick 'Compress the contents of the JAR file'
    Then click finish
    Hope I helped?
     
  3. Offline

    CraftCreeper6

    I export by refreshing the code right clicking the project clicking export then reload my server but it wont let me export it because of that error :/
     
  4. When you click export, it should open a popup window of how you want to export the file
     
  5. Offline

    CraftCreeper6

    WD_MUFFINFLUFFER
    1) I click Jar file
    2) Export generated class files and resources
    3) Finish
    4) Yes
    5) Get error....
     
  6. Offline

    Zethariel

    I think that "name" in plugin.yml refers to the name of the plugin, as in the filename. Make it less funky, it might not handle the spaces well.
     
  7. Offline

    CraftCreeper6

    Zethariel
    JAR creation failed. See details for additional information.
    Class files on classpath not found or not accessible for: 'Minigame (RickyBGamez and CraftCreeper6)/src/me/CraftCreeper6/utilites/InvGUI.java'
    plugin.yml:
    name: Minigame
    author: CraftCreeper6
    main: me.CraftCreeper6.utilites.InvGUI
    version: 1.0
    description: TEST
    commands:
    minigame :
    description: TEST
    set leavespawn:
    description: TEST
    leave:
    description: TEST
     
  8. plU
    For the plugin.yml the description should be
    Description: >
    And below the : on the next line write the description

    Ignore the top part that says "plu" and the extra quote, I was typing that on my phone >.<

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
Thread Status:
Not open for further replies.

Share This Page