• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The infamous "NoClassDefFoundError"

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. Yesterday, I read through all the threads on this topic, and got my work comp compiling and running without a problem. This morning I'm trying it at home, and I'm still getting the error

"Exception in thread "main" java.lang.NoClassDefFoundError: Test

I've got my CLASSPATH set to the following

.;C:\Program Files\Java\j2re1.4.2_05\lib\ext\QTJava.zip; C:\java stuff; C:\Program Files\Java\jdk1.5.0_06\bin

I can compile with javac just fine, but running the Test.class with the java command doesn't work.

What silly, simple thing am I missing? I'm not typing java Test.class, I've got my capitalization correct, I've tried it in both C:\java stuff (where I have the Test.class file) and in just straight C:\.

If you're not too tired of these, help would be appreciated.

Thanks!
 
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your class with in some package?
 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't write

Don't do: java Test.class

Do: just type java Test


Because Java run the class files without the ".class"
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ankur Sharma:
Don't do: java Test.class



Hmmm....that's what he said, isn't it?

Originally posted by Jason Greenwood:

I'm not typing java Test.class

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...ext\QTJava.zip; C:\java stuff; C:\Program ...

Remove the spaces between the ; and C:\... in your classpath.
 
Jason Greenwood
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mani Ram:
Is your class with in some package?



Nope, all alone in it's own folder, straight off C.


Originally posted by Jesper Young:
...ext\QTJava.zip; C:\java stuff; C:\Program ...

Remove the spaces between the ; and C:\... in your classpath.



Ooohh... interesting... wouldn't have thought of that! Now I need to run home and change my CLASSPATH!

Thanks for the replies, all! I'll let you know if that works, Jesper!

 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jesper Young:
...ext\QTJava.zip; C:\java stuff; C:\Program ...

Remove the spaces between the ; and C:\... in your classpath.



Remove your CLASSPATH setting altogether and start again.
This QuickTime software seems to be causing a myriad of problems when it sets the CLASSPATH during install.
reply
    Bookmark Topic Watch Topic
  • New Topic