April 11th, 2003, 01:23 PM
and yet another n00b
hey guys ,
I've just started learning java , and I've ran into a preety wierd problem . I wrote a test program , compiled it :
and then ran it
It all went fine ... Afterwards , I don't remember to have touched anything on the system . I tried runing a second program I wrote , after compiling it fine it came up with this :
bsd1# java test.class
Exception in thread "main" java.lang.NoClassDefFoundError: test/class
I looked through the program and could not see anything wrong . I've simplified it so that i'd be sure there are no errors , and after compiling it successfully once again , I got the same error .
I then tried copying , word by word an example from the book , and after compiling fine ... it gave me the same error .
I tried about 3 more examples from the book , and eventually I have recompiled the first program that i managed to run , but even that one showed me the same error . . .
I'm using jdk1.4 on FreeBSD 4.8 . I eventually tried rebooting and I tried using the linux jdk with linux emulation on freeBSD , but ... once again ... resulted in the same error ...
Can anyone help out at all with this ?
Thanks in advance
April 11th, 2003, 01:32 PM
when you type 'java test.class' it is looking for a class called 'class' in the 'test' package. That's why the error is java.lang.NoClassDefFoundError: test/class. See how test/class looks like a directory structure.
April 11th, 2003, 01:34 PM
haha many thanks ...
i guess i deserve a kick in the behind for the question :P ... but i was a bit paranoid considering everybody is badmouthing FreeBSD's compatibility with Java and I thought that right away there is something wrong with my system ...