NetBeans, java.lang.NoClassDefFoundError:

The heading of this post is suggest the problem that face by a newbie who try to run a JavaApplication in NetBeans. There is a bug in NetBeans actually , there is no error in your code. I had write a simple hello program in NetBeans but i get error 
java.lang.NoClassDefFoundError: hello/Hello…
and if you run this same code in eclipse , that i had done then the same program run with no error.
so I come to the conclusion that there is some problem with the NetBeans and start finding out the problem. Then i got the solution!


select JavaApplication

Step-2  give name to your project. (i have given hello)
uncheck Create Main Class

Step-3  Now right click on the project and select New Class
Type Hello as class name then click finish.
the program will look like this.

package hello;
 * @author Abhishek */
public class Hello {
     * @param args the command line arguments
    public static void main(String[] args) {
        // TODO code application logic here

save the  program and then run will get the output.