• 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

exception in thread main java.lang.noclassdeffounderror

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
}
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@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
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think tom has provided the link that's why i didn't...
 
William Pair
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic