Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


why should we get the following error ?
Exception in main method NoClassDefFoundError:classname

could anyone give the detail clarification on how java
compiler can look for .class file?

Answers were Sorted based on User's Feedback



why should we get the following error ? Exception in main method NoClassDefFoundError:classname ..

Answer / hardik

In most gnral mistech one make is file name and class name
error than this error accurs mostly , or no classname found
when the environment variable or class path is not given

Java compilor search for the path given to the class name
(ig in cmd javac searching in same folder if we have given
path = ./) .class files than java command searchs for the
same path but if it is not given to the same this error
comes. and java compilor never looks for the class file it
looks for the the .java file and it creates .class file
which than looked by java run time environment.

Is This Answer Correct ?    3 Yes 0 No

why should we get the following error ? Exception in main method NoClassDefFoundError:classname ..

Answer / narsimharaju

When we compile our java .class file then it is not available then we will get a runtime exception saying
NoClassDefFoundError:classname.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is aggregation?

1 Answers   Cap Gemini,


What is java reflection api?

0 Answers  


How does singleton class work?

0 Answers  


What's the default access specifier for variables and methods of a class?

0 Answers  


What is clipping and repainting and what is the relation between them?

1 Answers  


Suppose there is an array list [10,5,20,19,15,24].Print them in ascending & descending order in collection framework concept ???

2 Answers   Cognizant,


what is the purpose of the runtime class?

0 Answers  


Why should we use singleton pattern instead of static class?

0 Answers  


Difference between process and thread?

0 Answers   HP,


Why are strings immutable in Java?

1 Answers  


Hi friends, i am new to java. can you explain how java is secured.

2 Answers  


What is the history of java?

0 Answers  


Categories