Exception in thread “main” java.lang.NoClassDefFoundError

Posted: May 9, 2012 in Java


It is raised automatically by the JVM, when ever class loader unable to find the required ‘.class’. It is JVM exception.


public class Test { 

public static void main(String[] args) {

System.out.println(“Hello World”);


Note: observe here we have Test.java but we dont have Gopal class. so if you run Java Gopal you will get NoClassDefFoundError.

java Gopal 


Exception in thread “main” java.lang.NoClassDefFoundError: java Gopal

 if there is no Gopal ‘.class’ file we will get NoClassDefFound Error


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s