Exception in thread “main” java.lang.NoClassDefFoundError

Icon from the Tango Desktop Project

In response to my previous Java post, I got a DM on Twitter from another university student asking if I'd come across the above error before. Often I do, when I'm programming in a dazed stupor at 3am, and I've done this:

% javac Something.java
% java Something.class

Instead of this:

% javac Something.java
% java Something

The error can be caused by any number of factors, but 99% of the time it's because of this. Much hair ripping has resulted from it!

(It turns out this was the problem. Glad I could help ^^)


Imprint

This is one of about 5000 posts on Rubénerd. View the home page for the latest, or related posts also tagged with:

If you liked this post, feel free to buy me a coffee, leave me a comment on Twitter, or email me at weblog2017@rubenschade.com. Thanks :).