#1
  1. No Profile Picture
    Mentat of IX
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Bucuresti / Toronto
    Posts
    112
    Rep Power
    12

    Arrow 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 :
    javac program.java
    and then ran it
    java program.class

    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
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    7
    Rep Power
    0
    java test

    not

    java test.class

    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.

    Later.
  4. #3
  5. No Profile Picture
    Mentat of IX
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Bucuresti / Toronto
    Posts
    112
    Rep Power
    12
    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 ...

IMN logo majestic logo threadwatch logo seochat tools logo