NoClassDefFoundError

Discussion in 'Plugin Development' started by CXdur, Mar 6, 2015.

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

    CXdur

    Hey,

    I get this issue from time to time, not because I haven't exported my classes correctly, but because eclipse simply leaves them out sometimes. I'm not really sure, but it seems to target these classes:

    InteractWithNPCEvent.java
    StopThread.java
    SignInteract.java
    TalkWithNPCEvent.java

    So I was wondering, is there a way to actually prevent it from leaving classes out at all?

    I switched over to maven a while ago, and it happens here as well, Sometimes the class simply isn't included in the jar file I think.
     
  2. @CXdur Try reinstalling Eclipse/Maven and post all 4 classes that are being left out.
     
  3. Offline

    CXdur

    @CodePlaysMinecraft

    The thing is that only occasionally it leaves out a couple of classes. I've tried reinstalling before - could it be because of the size of the project?
     
  4. @CXdur More than likely no, I have a plugin that has about 40 classes, and it exports perfectly. When exporting, do you get any errors? Like "plugin.yml couldn't be compiled"? If there is an error, please post it.
     
  5. Offline

    CXdur

    This plugin has 150 classes+. No, there's no errors, it's just eclipse being buggy.
     
  6. @CXdur Huh. Well, that's a huge plugin you got there. :) Anyway, what type of Eclipse do you have installed? I have Eclipse Kepler. Try installing another type of Eclipse, and if the error persists, you may have to contact the developers of Eclipse/Maven.
     
  7. Offline

    teej107

    I had this problem too a while ago. I fixed it by using IntelliJ.
     
  8. Offline

    Tecno_Wizard

    Same exact thing. Eclipse does not handle large projects well.
     
  9. Offline

    CXdur

    @teej107 @Tecno_Wizard

    I might wanna switch then, what do you guys think of IntelliJ versus Eclipse?
     
  10. Offline

    teej107

    @CXdur Eclipse's program has an easier learning curve. IntelliJ takes a little longer to get used to in my opinion but don't let that be a downside. IntelliJ is far better than Eclipse. Its code editor is far more efficient, uploading to GitHub is easy as 123, I think it's a better made application overall. Switch to IntelliJ now rather than later and you won't be disappointed.
     
    Funergy likes this.
  11. Offline

    Tecno_Wizard

    @CXdur, IntelliJ, as @teej107 said, is FAR more powerful than eclipse and doesn't have those problems/ will tell you the cause. I'll give you a little run down of the things that IntelliJ can do that eclipse can't, and of course, the other way around.

    Pros
    • Using version control is far better with in-program terminal/command window. Will work with pretty much any version control program out there, and it has a knack for Github like no program I have ever seen.
    • Code inspector is not only for syntax errors. The code inspector will warn you about misspellings, unused code, unused variables, violations of naming conventions, dead code, some "bug finder" that I have no idea how it works, but it's right 80% of the time... Kind of scary actually, and I'm finding more and more things to add to this list every day.
    • The shortcuts. Holy crap the shortcuts. There are probably more shortcuts in this program to do things than I will learn in my lifetime. You probably could generate an entire object that just stores data in about 15 seconds. Just make the data members and intelliJ generates the rest. It's scary.
    • Exporting NEVER fails. It's awesome. Eclipse has issues with compiling programs that you will never see in IntelliJ. Albeit it's a bit more complicated, but that extra little work means that later, exporting literally takes 2 clicks.
    • Indented code is given vertical lines to show the start and end of an indented block of code. (Added a pic for this, it's hard to explain) upload_2015-3-7_8-11-5.png
    • Can auto-generate iterators with insane intelligence. If you have an ArrayList for example and you type for then Ctrl+space, then choose for iterator, it gives you the option for a normal for iterator or a for each, then puts that arraylist in the length or object to iterate through. It's awesome.


    Cons

    • I'm currently searching for a solution to this. If you give a method a javadoc comment in eclipse, that javadoc is immediately useable. Not in intelliJ.
    • Javadocs will not appear while using the Ctrl+space to list through possible methods. Again, searching for a way to fix that. (EDIT: Found out how to do that, hit Ctrl+q on the entry)
    • It's overall more complicated.

    So, that's that. If it's any more of a statement, this is the program that Google's Android Studio is built on top of, so you know it's some quality stuff. I just really hope that curse will get to repairing the javadocs soon, because you can't even really see the parameters without them.
     
    Funergy likes this.
Thread Status:
Not open for further replies.

Share This Page