Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception in main thread

 
Arajeshh Kumara
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ranchers,
I have installed jdk5.0 in my system, and i have set the class path and path in the environment variables but when i run my application i get the class not found exception and exception in main thread exception. i need to know the information urgent please reply me as soon as possible.

Thanking you,
bye
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the exact error message you are getting.

If the NoClassDefFoundError shows "/class" at the end of it, then you are typing ".class" when you invoke java from the command line. Leave off the .class extension and it should work fine.

If there is not a "/class" at the end of it, then it could be your CLASSPATH. You probably should not have a system CLASSPATH set at all. If you do, then it should include a dot (.) for the current directory. To verify whether this is the problem, try running with a classpath flag for the current directory (java, space, -cp, space, period, space, filename without extension)...

java -cp . MyFile
 
Austin Lee
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be care of the captial and lower case, when confuse, maybe will led such error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic