I had executed a simple prog Iam getting this error
""exception in thread main java.lang.noclassdeffounderror""
Can U give Me Solution for this.....
Printable View
I had executed a simple prog Iam getting this error
""exception in thread main java.lang.noclassdeffounderror""
Can U give Me Solution for this.....
I had executed a simple prog Iam getting this error
""exception in thread main java.lang.noclassdeffounderror""
Can U give Me Solution for this.....
Hi,
Whether ur file got compiled? Are u able to see your class file.
Ur path is correct?
Gothru this article for guidance.
JavaWorld Forums: Exception in thread "main" java.lang.NoClassDef...
Code:import java.awt.*;
import java.applet.*;
import java.io.*;
public class MenuDemo {
public static voidmain(String args[])
{
MenuBar mb =new MenuBar();
Menu f1=new Menu("file");
f1.add(new MenuItem("new"));
f1.add(new MenuItem("open"));
f1.addSeparator();
f1.add(new MenuItem("save"));
f1.add(new MenuItem("save as"));
f1.addSeparator();
f1.add(new MenuItem("close"));
mb.add(f1);
Frame f=new Frame("Menus Demo");
f.setSize(300,300);
f.pack();
f.setVisible(true);
}
}
Your void and your main words are concatenated together. Is this a typographical error or is this how your program truly looks? In other words, this:
should look like this:Code:public static voidmain(String args[])
Also, you really should be learning Swing, not AWT.Code:public static void main(String args[]) // note gap between void and main