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?
Answer Posted / 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 |
Post New Answer View All Answers
What is broken and continue statement?
Why do we use return statement?
What is meant by nested loop?
What are the methods to rectify ambiguities in the interfaces in JAVA?
How do you create an array in java?
What is void in java?
Explain the selection sort algorithm?
What are generic methods?
Can we access instance variables within static methods ?
Difference between a process and a program?
what is meant wrapper classes?
What is jagged array in java?
Is null keyword in java?
What is the difference between replace and replace all?
What is map in java?