Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error while executing.. NoClassDefFound error.

 
Deepak Damodaran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii everybody..

i have complied a program(or any program) but when i satrs to execute it shows an error of

Exception in thread "main" java.lang.NoClassDefFoundError:classname/java

can anybody tell me how to fix this problem....
 
mohsen fakhari
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Obviously it cannot find one of your classes!
Maybe the class is not in your classpath.
Maybe you've misspelled its name.
Maybe...
 
Deepak Damodaran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i hav set classpath.. even class mae is also correct..but even a simple HELLO program is not workin
 
fred rosenberger
lowercase baba
Bartender
Posts: 12146
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should probably be in the beginner's forum.

However, when you run your program, are you typing

"java classname.java"?

or are you typeing

"java classname"?
 
Deepak Damodaran
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i hav typed " java class name " but still error occurs.. but i cleared it . i had to reinstall java it is okay now thank you guys for your comments
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exception in thread "main" java.lang.NoClassDefFoundError:classname/java

The "/java" at the end of the error message indicates that you have typed:

java classname.java

instead of:

java classname

Re-installing Java was not necessary... :roll:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic