When I compile a .java file it creates the .class file. But when I try to run that file then it shows the java.lang.NoClassDefFoundError : class name. Here class name is the name of class which I am trying to run. Previously many times I ran the programs but it is the first time that I got this type of error. Environment variable is already set.