Java gives an Exception in thread “main” java.lang.NoClassDefFoundError
This happened to me in Red Hat 8.0 with Sun’s j2sdk1.4.1_01, though I think it happens with a lot of Java packages. My problem was that I was writing at the command line:
bash> java my_program.class
I should not have included the .class in my command line call. I just had to make sure that I was calling java from the directory where my class file was stored.
Comments