Class files not found or not accessible (Eclipse)

Discussion in 'Plugin Development' started by DogeDebugger, Oct 12, 2014.

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

    DogeDebugger

    I never exported an Eclipse project before. My code is perfect. I went to export>click on my project>selected classpath and project > Finish.

    It says "Jar creation failed. See details for more info." Then
    Code:
    JAR creation failed. See details for additional information.


    Code:
    JAR creation failed. See details for additional information.
      Class files on classpath not found or not accessible for: 'BatmanPlugin/src/me/Thomas/ThrowBatarangGrenade.java'
      Class files on classpath not found or not accessible for: 'BatmanPlugin/src/me/Thomas/UltrasoundCall.java'
    
    Help please!
     
  2. Offline

    pookeythekid

    DogeDebugger Have you tried watching the exact steps on YouTube or something? My first plugin was off of a tutorial by TheBCBroz, he makes it clear on how you're supposed to do it.
     
  3. Offline

    xTrollxDudex

    Uh

    no
     
    Gamecube762 and es359 like this.
  4. Offline

    Monkey_Swag

    I've had this problem multiple times. Still have no idea what causes it. Close Eclipse and re-open it. That should fix it.
     
  5. DogeDebugger Monkey_Swag A lot of the time this error happens because Eclipse was not able to attempt to compile the Java file for some reason. The most common cause I see with this is when the project cannot be built, Eclipse does not attempt to compile the classes, so it gives that error when exporting. Try looking at your "errors" section of Eclipse - does it say anything? Often it will have an error like "Project cannot be built until build path errors are resolved".
     
  6. Offline

    DogeDebugger

    AdamQpzm
    Thanks. Turns out it was something about my build path.
     
    AdamQpzm likes this.
  7. Offline

    pookeythekid

    xTrollxDudex Lol, what do you hold against TheBCBroz? If it's his coding style, you may not favor it, but I never said I make an exact replica of whatever he types on that screen; that's a terrible way to learn anything.
     
  8. Offline

    xTrollxDudex

    Bad habits. Coding style is second to that, BC it sucks too. BCBroz has inefficient, although better code than in the past, but still can be improved major.
     
  9. Offline

    pookeythekid

    xTrollxDudex Bad habits? Inefficient? On what ground can you make these claims?
     
  10. Offline

    xTrollxDudex

  11. Offline

    DogeDebugger

  12. Offline

    pookeythekid

    Alright, you got some pretty good points. However, all but one of these bad habits I have strayed from--except for checking the command name with label. What exactly is wrong with that, anyway? Seems to work for me.

    Just a side note: See my plugin, SecureLogin. (Is that some sort of not-allowed advertising? If so I'll remove the link). I would call that pretty successful, and I was fairly new to Bukkit and Java when I released the first file, and I was learning off of nothing but BCBroz--but then, in my latest versions I'm far more advanced in my coding.
     
  13. Offline

    teej107

    Nothing is wrong with using the command name with label. You just lose all support for aliases. To tell you the truth, all my plugins could use that since I don't create any aliases at all. But I still use Command.getName() since it's a good habit to do so.
     
    mythbusterma likes this.
  14. Offline

    mythbusterma

    pookeythekid

    Just because you did well and learned better than his ways, doesn't mean others will, and that is the problem.

    Doing unchecked casts, abusing static, bad naming schemes, just to name a few of the problems in his "code."

    We need to stop anyone from using these, as they will learn these bad practises and teach others them, as you can see happens every day on this forum.
     
    pookeythekid likes this.
  15. Offline

    pookeythekid

    teej107 ... Oh... I am so switching to cmd.getName(). I find it a little untidy of my code to use "... || label.equalsIgnoreCase(<command>)". Although all my plugins only have a maximum of one alias per command.

    Edit: mythbusterma ;P I just got ninja'd.
     
  16. Literally the next thing you say contradicts this.

    See? This is clearly something wrong, even if it doesn't affect you. And just because you don't use aliases in your plugin, doesn't mean that there aren't aliases used for any of your plugins. I remember before I became a plugin developer, someone told me that the easiest way to have aliases for commands was to just open the plugin's jar, and change the plugin.yml.

    I didn't really understand how that worked, but it worked quite nicely and meant I didn't have to get an alias plugin and configure that. Just seemed easier to me. I noticed that, for some reason, it just didn't work with certain plugins, and I couldn't figure out why. After becoming a developer, I understood why. It was very frustrating that people had broken a feature needlessly.
     
  17. Offline

    teej107

    Why would you even modify a jars contents in the first place and expect it to work? It's the same reason why Bukkit doesn't support Spigot and BungeeCord.
     
  18. teej107 It's editing the plugin description file, not really the jar itself. Trust me, it does work except in cases of poorly made plugins.
     
Thread Status:
Not open for further replies.

Share This Page