Whenever i am trying to execute my program, the run time exception arises saying “Exception in thread “main” java.lang.NoClassDefFoundError”. This happens for every program i try to execute. There are no compile time errors. But while executing, this error occurs. Has this got to do anything with the path settings? Or is this something else…? Please help. All my programs are stuck at execution… 
This is one of the program’s that i’m trying to execute which didnt.
import javax.swing.*;
public class NewGui
{
public static void main(String[] args)
{
JFrame frame=new JFrame();
JButton button=new JButton(“Click Me”);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(button);
frame.setSize(300,300);
frame.setVisible(true);
}
}
It compiled but didn’t execute.
The command i used to compile was
javac NewGui.java
and the command to execute was
java NewGui
Also, Under the environment variables option, we got two options. One is a CLASSPATH and the other one is Path. I edited the Path section and added the following two paths:
C:\Program Files\Java\jdk1.6.0\bin;C:\Program Files\Java\jdk1.6.0\lib;
So is this fine or do I need to add some other paths also?
Please help…