문제

I just came across an error when using NetBeans, and I wanted to post my findings (possible this is old news). Perhaps this will save some people the headache of debugging a similar problem that I just encountered. I don't think I'm abusing anything here... stack overflow's SEO is pretty good :)

I refactored a class in NetBeans (JavaFX project), and from that point on I got a "java.lang.NoClassDefFoundError" for that particular refactored class.

I fixed the error by simply doing a "Clean and Build Project." This apparently deleted whatever cache file or erroneous file/class reference. I don't think this is a Netbeans bug... hoping it was just one of those "flukey" moments.

Cheers!

도움이 되었습니까?

해결책

I have those issues from time to time when I write new code (or create new code). This is because I use the 'build' function instead of 'clean & build'.

Most of the time, the proper set of class is compiled (or recompiled), but there are situations where newly compiled classes are not compatible with already compiled classes. That's when I get java.lang.NoClassDefFoundError. Not a big deal. Just need to clean and recompile everything.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top