Exception in thread “main” java.lang.NoClassDefFoundError

Software

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 ^^)

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

You can leave me a comment by contacting me, and I might publish your thoughts. Please read the FAQs first though.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!