aspose file tools*
The moose likes Beginning Java and the fly likes exception in thread main java.lang.noclassdeffounderror Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "exception in thread main java.lang.noclassdeffounderror" Watch "exception in thread main java.lang.noclassdeffounderror" New topic
Author

exception in thread main java.lang.noclassdeffounderror

William Pair
Greenhorn

Joined: Jun 26, 2010
Posts: 2
I cannot get past this. I can compile and get no errors, but when I try to run my little program I get the above error. I have updated my PATH in the System Variables of the Enviroment Variables just like in step 4 of the installation guide instructs.

import java.awt.*;
import java.awt.event.*;
class Party {
public void buildinvite() {
Frame F = new Frame();
Label l = new Label("Party at Tim's");
Button b = new Button("You bet");
Button c = new Button("Shoot me");
Panel p = new Panel();
p.add(l);
} // more code here...
}
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
When posting code please UseCodeTags. Please explain how you ran it. I don't see a main() function. This is probably a classpath problem. Did you set your classpath?
Inder Kumar Rathore
Ranch Hand

Joined: Apr 14, 2010
Posts: 41
First of all welcome to java ranch.
William you are compiling your code that's Ok but how you are running it.
either provide whole source code or just explian.
And tom he is new to java ranch as it is his first post.
So errors can be there.
William just use proper tags to make your post more readable..

Thanks

Living is easy with your eyes closed.....
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

@Inder: Tom asked the right questions and provided a link regarding code tags--just telling someone to use the "proper tags" without providing a reference for how to do so doesn't really help.
Inder Kumar Rathore
Ranch Hand

Joined: Apr 14, 2010
Posts: 41
I think tom has provided the link that's why i didn't...
William Pair
Greenhorn

Joined: Jun 26, 2010
Posts: 2
Thanks everyone for all your help and advise. I will be a better greenhorn on my next posting. Yes I was able to correct my issue by adding a "main" method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception in thread main java.lang.noclassdeffounderror