• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Exception when the program is executed.  RSS feed

 
Vijay Sharma
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Am able to compile the program anc can create the .class file of any valid java source file. But when I execute java <file name>, its throwing and exception which looks some thing like this.
Error: "Exception in thread "main" java.lang.NoClassDefFoundError: WindowCloser" even though the class file have been created. I even tried to execute some of the stored class, still no go, am getting the same exception.

Can anyone please help me with this problem?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've set your CLASSPATH environment variable, and it doesn't include dot (.), which stands for the current directory. The very best setting for CLASSPATH for a Java newbie is to not have it set at all. Go to your control panel, delete that variable definition entirely; restart your command prompt, and your problem will be fixed.

A bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. A single name isn't enough. You can change your display name here. Thanks for your immediate attention.
 
Vijay Sharma
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks sheriff. The problem is solved now. I have changed the request which you have made.
Thanks once again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!